You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say you have a base class Base which includes HTTParty, sets some default headers, and then a subclass which inherits from Base. If one of the subclasses overrides headers, they are overridden for all three classes.
AFAICT, this defeats the whole purpose of the magic in HTTParty::ModuleInheritableAttributes, and so I must assume it's a bug.
Say you have a base class Base which includes HTTParty, sets some default headers, and then a subclass which inherits from Base. If one of the subclasses overrides headers, they are overridden for all three classes.
AFAICT, this defeats the whole purpose of the magic in HTTParty::ModuleInheritableAttributes, and so I must assume it's a bug.
Proposed Fixes:
clone
call at line 21 of module_inheritable_attributes.rb.rb (https://github.com/jnunemaker/httparty/blob/master/lib/httparty/module_inheritable_attributes.rb) to instead be adeep_clone
, through one of the various strategies to achieve that result that are available.merge!
call at line 175 of httparty.rb (https://github.com/jnunemaker/httparty/blob/master/lib/httparty.rb) to NOT merge into the existing hash, but into a clone, like this:The text was updated successfully, but these errors were encountered: