-
Notifications
You must be signed in to change notification settings - Fork 561
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
WebMock::Util::Headers.normalize_headers
replaces underscores with dashes
#474
Comments
@mikekelly WebMock tries to normalize headers to have unified version for comparison with stubs. What exactly is the issue you have problems with? |
I'm stubbing a response which has a header called |
@mikekelly I see. You're right, WebMock should not do that. |
Do you know why the behaviour was added in the first place? |
Do you need someone to propose a solution in a PR? |
Right now I am using a monkey patch which resolves this issue, I could re-use that. |
It was added to ensure unified format of headers i.e. if case someone declares 'content_type' in the response. |
It's wasn't the best approach though. |
@mikekelly I made a pull request with some hacky code to get specs around how we are normalizing headers right now. Can you write a spec that fits you use case. If you don't get to it, I'll take a stab when I have some time. |
It's a huge problem!!! My temporary solution:
|
- Use VCR to capture HTTP interactions for s3 integration tests. - Use Timecop instead of sleep. - Clean up shared-test boilerplate. - Move AWS resource#to_a call outside of multithread block (attempt to resolve `JMESPath::Runtime#search` bug potentially caused by thread contention) - replace Fakeweb with WebMock
i have a PR ready to add a config, but i dont have access to push a branch.
i have it in my webmock spec support file and i use |
WebMock is unable to correctly mock server responses that include underscores in the header names because it replaces any underscores with dashes. Is there a specific reason for this behaviour? I checked the HTTP specification and underscores are not an illegal character.
The offending line is here:
webmock/lib/webmock/util/headers.rb
Line 10 in 6b5374c
The text was updated successfully, but these errors were encountered: