summaryrefslogtreecommitdiff
path: root/lib/chef/rest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/rest.rb')
-rw-r--r--lib/chef/rest.rb12
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