diff options
author | John Keiser <jkeiser@opscode.com> | 2013-10-08 20:40:08 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-10-09 09:21:02 -0700 |
commit | 836705dee684032baa85920c808a3eca5f5a8a87 (patch) | |
tree | eb6373c1ee4e352ba58c8beef0ddfd194b749cf7 /lib/chef/rest.rb | |
parent | a44352871130b3adea32c93bdaca696b518a335a (diff) | |
download | chef-836705dee684032baa85920c808a3eca5f5a8a87.tar.gz |
CHEF-4515: upload sometimes inflates JSON. Fix by using true raw version of Chef::REST
Diffstat (limited to 'lib/chef/rest.rb')
-rw-r--r-- | lib/chef/rest.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/chef/rest.rb b/lib/chef/rest.rb index d27a139104..236e4cbac2 100644 --- a/lib/chef/rest.rb +++ b/lib/chef/rest.rb @@ -58,10 +58,13 @@ class Chef options[:signing_key_filename] = signing_key_filename super(url, options) - @chef_json_inflater = JSONToModelInflater.new(options) - @cookie_manager = CookieManager.new(options) @decompressor = Decompressor.new(options) @authenticator = Authenticator.new(options) + + @middlewares << JSONToModelInflater.new(options) + @middlewares << CookieManager.new(options) + @middlewares << @decompressor + @middlewares << @authenticator end def signing_key_filename @@ -117,11 +120,6 @@ class Chef streaming_request(create_url(path), headers) {|tmp_file| yield tmp_file } end - # Chef::REST doesn't define middleware in the normal way for backcompat reasons, so it's hardcoded here. - def middlewares - [@chef_json_inflater, @cookie_manager, @decompressor, @authenticator] - end - alias :api_request :request alias :raw_http_request :send_http_request |