summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/http/handler.rb
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-01-19 15:17:08 -0800
committerMatt Robinson <matt@puppetlabs.com>2011-01-19 15:17:08 -0800
commit517c6794606e9adde7f2912d3b949cfcc18a446a (patch)
tree5aebb6b13563c1601200bca0c758b4b361da339e /lib/puppet/network/http/handler.rb
parent76d1c2aefb32cc3688e3f7c0a5c8bbf713a123ed (diff)
parent41090d3617d99f9eaa58df32be93f3d16467bc50 (diff)
downloadpuppet-517c6794606e9adde7f2912d3b949cfcc18a446a.tar.gz
puppet-517c6794606e9adde7f2912d3b949cfcc18a446a.tar.xz
puppet-517c6794606e9adde7f2912d3b949cfcc18a446a.zip
Merge branch '2.6.next' into 2.6.x
* 2.6.next: (21 commits) (#5900) Include ResourceStatus#failed in serialized reports (#5882) Added error-handling for bucketing files in puppet inspect (#5882) Added error-handling to puppet inspect when auditing (#5171) Made "puppet inspect" upload audited files to a file bucket Prep for #5171: Added a missing require to inspect application. Locked Puppet license to GPLv2 (#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 maint: Remove unused Rakefile in spec directory (#5171) Made filebucket able to perform diffs (#5710) Removed unnecessary calls to insync? Prep for fixing #5710: Refactor stub provider in resource harness spec Maint: test partial resource failure maint: Inspect reports should have audited = true on events ...
Diffstat (limited to 'lib/puppet/network/http/handler.rb')
-rw-r--r--lib/puppet/network/http/handler.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index 61ae2d2fc..9e9356b2f 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -109,7 +109,22 @@ module Puppet::Network::HTTP::Handler
format = format_to_use(request)
set_content_type(response, format)
- set_response(response, result.render(format))
+ if result.respond_to?(:render)
+ set_response(response, result.render(format))
+ else
+ set_response(response, result)
+ 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.