diff options
-rw-r--r-- | lib/chef_zero/endpoints/node_endpoint.rb | 4 | ||||
-rw-r--r-- | lib/chef_zero/rest_base.rb | 10 | ||||
-rw-r--r-- | spec/run_oc_pedant.rb | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/chef_zero/endpoints/node_endpoint.rb b/lib/chef_zero/endpoints/node_endpoint.rb index 98e88a0..471bc4a 100644 --- a/lib/chef_zero/endpoints/node_endpoint.rb +++ b/lib/chef_zero/endpoints/node_endpoint.rb @@ -20,6 +20,10 @@ module ChefZero super(request) end + def head(request) + head_request(request) + end + def populate_defaults(request, response_json) node = FFI_Yajl::Parser.parse(response_json) node = ChefData::DataNormalizer.normalize_node(node, request.rest_path[3]) diff --git a/lib/chef_zero/rest_base.rb b/lib/chef_zero/rest_base.rb index 367ce70..74ca014 100644 --- a/lib/chef_zero/rest_base.rb +++ b/lib/chef_zero/rest_base.rb @@ -231,6 +231,16 @@ module ChefZero [response_code, { "Content-Type" => "text/plain" }, text] end + # rfc090 returns 404 error or 200 with an emtpy body + # @param [ChefZero::RestRequest] request The HTTP request object + # + # @return (see #json_response) + # + def head_request(request) + get_data(request) # will raise 404 if non-existant + json_response(200, nil) + end + # Returns an Array with the response code, HTTP headers, and JSON body. # # @param [Fixnum] response_code The HTTP response code diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index c11eb4a..411b502 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -161,6 +161,10 @@ begin # Chef Zero does not intend to support authorization the way erchef does. "--skip-authorization", + # Chef Zero does not intend to support oc_id authentication/authorization + # the way erchef does. + "--skip-oc_id", + # Omnibus tests depend on erchef features that are specific to erchef and # bundled in the omnibus package. Currently the only test in this category # is for the search reindexing script. |