From 21681e8e30ad32738577f6c4456a61afab45fbe0 Mon Sep 17 00:00:00 2001 From: danielsdeleo Date: Sat, 5 Oct 2013 13:25:19 -0700 Subject: 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. --- lib/chef/http/http_request.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/chef') 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 -- cgit v1.2.1