diff options
| author | Paul Berry <paul@puppetlabs.com> | 2011-01-12 16:33:21 -0800 |
|---|---|---|
| committer | Paul Berry <paul@puppetlabs.com> | 2011-01-12 16:33:21 -0800 |
| commit | 2274d5104f6e413a2b8899a3c3111a17bbb2f4d7 (patch) | |
| tree | 023bf4e6313e4d40eccea6dd3819d70147a101f8 /lib/puppet/network/http | |
| parent | 271faa27c7906e87c2edee4bf2a3f3ca2143dadb (diff) | |
| parent | abc62560f78fa227d6ffd3263a095665609a15b5 (diff) | |
Merge branch 'ticket/2.6.next/5838' into 2.6.next
* ticket/2.6.next/5838:
(#5838) Support paths as part of file bucket requests.
(#5838) Improve the quality of file bucket specs.
(#5838) Make file bucket dipper efficient when saving a file that already exists
(#5838) Implemented the "head" method for FileBucketFile::File terminus.
(#5838) Reworked file dipper spec to perform less stubbing.
(#5838) Added support for HEAD requests to the indirector.
(#5838) Refactored error handling logic into find_in_cache.
(#5838) Refactored Puppet::Network::Rights#fail_on_deny
Diffstat (limited to 'lib/puppet/network/http')
| -rw-r--r-- | lib/puppet/network/http/api/v1.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/network/http/handler.rb | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb index dd4612a14..8aa1f0ee1 100644 --- a/lib/puppet/network/http/api/v1.rb +++ b/lib/puppet/network/http/api/v1.rb @@ -13,6 +13,9 @@ module Puppet::Network::HTTP::API::V1 }, "DELETE" => { :singular => :destroy + }, + "HEAD" => { + :singular => :head } } diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb index f22498b70..9e9356b2f 100644 --- a/lib/puppet/network/http/handler.rb +++ b/lib/puppet/network/http/handler.rb @@ -116,6 +116,17 @@ module Puppet::Network::HTTP::Handler end end + # Execute our head. + def do_head(indirection_request, request, response) + unless indirection_request.model.head(indirection_request.key, indirection_request.to_hash) + Puppet.info("Could not find #{indirection_request.indirection_name} for '#{indirection_request.key}'") + return do_exception(response, "Could not find #{indirection_request.indirection_name} #{indirection_request.key}", 404) + end + + # No need to set a response because no response is expected from a + # HEAD request. All we need to do is not die. + end + # Execute our search. def do_search(indirection_request, request, response) result = indirection_request.model.search(indirection_request.key, indirection_request.to_hash) |
