-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
per-request headers discard default headers #255
Comments
Yeah that makes sense. Happy to pull anything with good tests. |
Sorry - I won't have time for that. I'm primarily a Java & C# developer and Rails is a secondary skill. I'm not familiar enough with Cucumber. It would have been a good learning experience for me, but I'm a bit swamped at the moment! I can give you the patch for the line itself if that helps, but that a simpler one-liner which I'm sure you can do better than me anyway... :) |
Correctly merge default headers with request provided headers - fixes #255
Fixes opentok#60 because it includes fix for jnunemaker/httparty#255
In the following example:
The expected behavior is that the specific headers given for this particular request be merged with the default ones, so the final headers should be:
However because of the first line in HTTParty.perform_request:
The default headers are overwritten. This is due to the fact that merge isn't recursive - if the same key exists in both hashes it is overwritten. To merge in a different manner one must supply a block to handle conflicting keys.
I think in the specific case of
:headers
HTTParty should perform a deep merge.The text was updated successfully, but these errors were encountered: