diff options
author | Jeremy Miller <jeremymv2@users.noreply.github.com> | 2017-05-25 14:27:37 -0500 |
---|---|---|
committer | Thom May <thom@may.lt> | 2017-05-25 14:27:37 -0500 |
commit | 73ed88e08a3be39128481ebfdd08ac6e170b4965 (patch) | |
tree | 5f80dc47c51e8ee1770c5de7db0a0e3d0ab59ced /lib/chef_zero/rest_base.rb | |
parent | 0888deece36b15362f1d1eae9543c26b157dfd9c (diff) | |
download | chef-zero-73ed88e08a3be39128481ebfdd08ac6e170b4965.tar.gz |
implement rfc090 for named nodes endpoint (#264)
* implement rfc090 for named nodes endpoint
Signed-off-by: Jeremy J. Miller <jm@chef.io>
Diffstat (limited to 'lib/chef_zero/rest_base.rb')
-rw-r--r-- | lib/chef_zero/rest_base.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 |