gamache / hyperresource

A self-inflating Ruby client for hypermedia APIs. Not under active development.
http://hyperresource.com/doc
MIT License
304 stars 29 forks source link

Header caching bug across different HyperResource object instances #21

Closed fancyremarker closed 10 years ago

fancyremarker commented 10 years ago

I threw together a Gist describing the problem, but in sum: when I instantiate a new HyperResource instance with different headers, the effects of the headers don't take effect until I call get on the new instance.

This has a bunch of negative implications for multi-threaded applications (e.g., a Web server). (Consider the example of a memoized instance variable: @api ||= HyperResource.new(...).)

If you can point me at the code where these attributes are cached at the HyperResource class level, I can take a stab at fixing the bug.