diff options
author | Thom May <thom@chef.io> | 2017-01-18 11:31:19 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2017-02-14 10:22:23 -0800 |
commit | d4b87e5e0f73d92836b4523907e17b1a88be9317 (patch) | |
tree | 2c1cfe83eedec5c2a9d1c9bff40d07b3a8e75a4f /lib/chef/server_api.rb | |
parent | f76e23dd27410505440eb06a174c6ce8c5afb341 (diff) | |
download | chef-d4b87e5e0f73d92836b4523907e17b1a88be9317.tar.gz |
Beginning of automatic API version detection
When we make a request to a chef server, we capture the minimum and
maximum support API versions and allow them to be queried.
We then provide some infrastructure for making decisions on which class
should be used, in a middleware-ish mechanism.
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/server_api.rb')
-rw-r--r-- | lib/chef/server_api.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/server_api.rb b/lib/chef/server_api.rb index d233d25232..2bdc5d9fe8 100644 --- a/lib/chef/server_api.rb +++ b/lib/chef/server_api.rb @@ -24,6 +24,7 @@ require "chef/http/json_input" require "chef/http/json_output" require "chef/http/remote_request_id" require "chef/http/validate_content_length" +require "chef/http/api_versions" class Chef class ServerAPI < Chef::HTTP @@ -42,6 +43,7 @@ class Chef use Chef::HTTP::Decompressor use Chef::HTTP::Authenticator use Chef::HTTP::RemoteRequestID + use Chef::HTTP::APIVersions # ValidateContentLength should come after Decompressor # because the order of middlewares is reversed when handling |