Shopify/shopify_api — pull request #90 by peterjm (2014-01-10 18:06:53+00:00)
Title: Work with threadsafe version of headers method in ActiveResource 4

@maartenvg

## Problem

ActiveResource 4 changed the `headers` method to store the headers in a threadlocal variable, instead of a class variable on `ActiveResource::Base`, in an attempt to make it threadsafe.

However, this breaks the situation where multiple threads are being used, but the desired behaviour is to share the headers.

In ShopifyAPI, we do:
```
self.headers['User-Agent'] = "user agent string"
```

This will only run on the thread that `ShopifyAPI::Base` is loaded in, which means that if you create a new thread and make a ShopifyAPI request, there won't be a user agent header.

## Solution

Merge the user agent header dynamically, instead of statically.