1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
Commit graph

5 commits

Author SHA1 Message Date
Marc Slemko
2b5fc1917d Support gzip/deflate transfer encoding when explicit headers are set.
httparty relies on Net::HTTP's built in transparent support for gzip and deflate
transfer encoding, however that did not work if you specified your own explicit headers
because calling Net::HTTPHeader#initialize_http_header overwrites the work done in
Net::HTTPGenericRequest#initialize to set the default User-Agent, Accept,
and Accept-Encoding.  This also removes the need to duplicate the logic in
Net::HTTP around not decoding the response if the caller has explicitly set
the Accept-Encoding for their own purposes.

This does introduce a slight incompatible change in behavior where
previously specifying any custom headers would omit the default headers,
while with the new behavior you can override the values however
can't omit them entirely.

While I'm here, also remove the test for HEAD requests added in
4797c7696d because it was not properly
testing what it claimed to and the code it was trying to test was
removed in 6f6bf6b726 anyway.
2019-11-28 15:23:35 -08:00
Brad Cater
4797c7696d Added cucumber tests for HEAD request to gzipped asset. 2013-08-05 14:17:52 -04:00
Sandro Turriate
d018df223c Cucumber suite sends unique requests
Helpful for testing ephemeral response
2010-07-07 08:54:22 -04:00
Sandro Turriate
ad6b06d605 Decode gzip'd responses like Ruby 1.9
Thanks to carsonmcdonald for the inspiration
Closes gh-40
2010-06-12 00:48:52 -04:00
Sandro Turriate
d950d38d3a Automatically inflate deflated responses 2010-06-12 00:48:52 -04:00