Skip to content

Fix Rack response mutating request headers #367

Merged
merged 1 commit into from Feb 12, 2014

2 participants

@bjeanes
bjeanes commented Feb 10, 2014

This came up when a before(:each) {} RSpec block set up a general Rack-backed stub for all requests to a domain and an individual spec placed a further expectation on the request for the Content-Type header. To our surprise, the Content-Type header was mysteriously vanishing.

@mattonrails and I traced it to WebMock and were able to write a failing test and fix the issue with no other failing specs. The spec we wrote is probably not in an ideal location so I'm happy to move it around with your feedback.

If you uncomment our diff in lib/webmock/rack_response.rb, you'll see the spec fail with the Accept header still present, but the Content-Type header missing and unable to be matched against.

@bblimke
Owner
bblimke commented Feb 12, 2014

@bjeanes @mattonrails thank you for fixing that!

@bblimke bblimke merged commit 5ea07eb into bblimke:master Feb 12, 2014

1 check failed

Details default The Travis CI build could not complete due to an error
@bblimke
Owner
bblimke commented Feb 12, 2014

I'll move the spec to appropriate file.

@bblimke
Owner
bblimke commented Feb 12, 2014

Released as 1.17.3. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.