summaryrefslogtreecommitdiff
path: root/lib/chef/http
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-07-28 14:04:49 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-07-28 14:07:57 -0700
commitd9b9ea1a737772cf0d3c3a3064057b60c47a9549 (patch)
tree781db4d737bdaef44b3e304a628b23eae8491741 /lib/chef/http
parentd8e128634615246695f5ff82d7d415db89fc8708 (diff)
downloadchef-d9b9ea1a737772cf0d3c3a3064057b60c47a9549.tar.gz
Fix protocol negotiation for unversioned objects
We generally always do protocol negotiation on the get of the node object and the Chef::Node is an unversioned API, so we need to test that we backoff the API version to the highest version the server offers and then retry again. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/http')
-rw-r--r--lib/chef/http/authenticator.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/http/authenticator.rb b/lib/chef/http/authenticator.rb
index e65e93d2ac..4a29fcea33 100644
--- a/lib/chef/http/authenticator.rb
+++ b/lib/chef/http/authenticator.rb
@@ -68,6 +68,8 @@ class Chef
version_class.best_request_version
elsif api_version
api_version
+ elsif Chef::ServerAPIVersions.instance.negotiated?
+ Chef::ServerAPIVersions.instance.max_server_version.to_s
else
DEFAULT_SERVER_API_VERSION
end