diff options
author | danielsdeleo <dan@opscode.com> | 2013-10-05 13:25:19 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-10-08 15:01:47 -0700 |
commit | 21681e8e30ad32738577f6c4456a61afab45fbe0 (patch) | |
tree | 552ffde0b63c080aab0d5a1caa1cd11322f22d6b /lib/chef | |
parent | e28507bc3acdb5fc41da166bc1324754b11b7904 (diff) | |
download | chef-21681e8e30ad32738577f6c4456a61afab45fbe0.tar.gz |
Fix disable gzip for Ruby 2.0
If we've not set an accept encoding by the time we're making a request,
set the accept encoding to request "identity" only. Ruby 2.0 seems to
have some sort of built-in gzip support that we need to explicitly
disable.
Note that prior to this patch, we were _always_ advertising gzip
support, but we would skip decompression if disable_gzip had been set,
which only did the right thing accidentally.
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/http/http_request.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb index e0edbf7217..f67d966e5e 100644 --- a/lib/chef/http/http_request.rb +++ b/lib/chef/http/http_request.rb @@ -125,6 +125,8 @@ class Chef def build_headers(headers) @headers = headers.dup + # No response compression unless we asked for it explicitly: + @headers[HTTPRequest::ACCEPT_ENCODING] ||= "identity" @headers['X-Chef-Version'] = ::Chef::VERSION @headers end |