summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/http
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-20 23:37:13 -0500
committerLuke Kanies <luke@madstop.com>2008-08-20 23:45:29 -0500
commit7034882fdfbd3846e77c518e43bdea1f9154e250 (patch)
treec0ac8f53f60dfb4febea33bb37f9c4099a3d1322 /lib/puppet/network/http
parent66c40b374d7315d11575d701ce195ce656abbeb7 (diff)
downloadpuppet-7034882fdfbd3846e77c518e43bdea1f9154e250.tar.gz
puppet-7034882fdfbd3846e77c518e43bdea1f9154e250.tar.xz
puppet-7034882fdfbd3846e77c518e43bdea1f9154e250.zip
Adding parameter and URL support to the REST terminus.
Previously, the server side correctly pulled parameters out of the query strings, but the REST terminus never passed them on. It does now, at least for finding and searching. It appears that at least WEBrick doesn't support parameters for anything other than forms and GET. I've also added the ability for the REST terminus to pull host/port information from the request key, if it's a URI. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/network/http')
-rw-r--r--lib/puppet/network/http/handler.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index 291481acd..6f5117b16 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -81,7 +81,11 @@ module Puppet::Network::HTTP::Handler
# Execute our search.
def do_search(request, response)
args = params(request)
- result = model.search(args)
+ if key = request_key(request)
+ result = model.search(key, args)
+ else
+ result = model.search(args)
+ end
if result.nil? or (result.is_a?(Array) and result.empty?)
return do_exception(response, "Could not find instances in %s with '%s'" % [model.name, args.inspect], 404)
end