diff options
author | Thom May <thom@chef.io> | 2017-06-07 16:09:01 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2017-07-05 12:20:35 +0100 |
commit | 35e24b6125089cd6bc71c7092e431562707ee8cd (patch) | |
tree | bf8384c3ae80a28f2f57012d67fd541ea92c1ffd /lib/chef/http | |
parent | e419d7f0eb0c494a0a2f5d5963eac6fb35153bac (diff) | |
download | chef-35e24b6125089cd6bc71c7092e431562707ee8cd.tar.gz |
Have a sensible default for old chef serverstm/no_api_version
If we don't see a version header, we should default to only supporting
API version 0, and if we can't support that, then we should die as usual
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/http')
-rw-r--r-- | lib/chef/http/api_versions.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/http/api_versions.rb b/lib/chef/http/api_versions.rb index 674d8f85a7..6c5ede40aa 100644 --- a/lib/chef/http/api_versions.rb +++ b/lib/chef/http/api_versions.rb @@ -37,6 +37,8 @@ class Chef end if http_response.key?("x-ops-server-api-version") ServerAPIVersions.instance.set_versions(JSONCompat.parse(http_response["x-ops-server-api-version"])) + else + ServerAPIVersions.instance.unversioned! end [http_response, rest_request, return_value] end |