summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-19 16:09:58 -0600
committerLuke Kanies <luke@madstop.com>2009-02-19 17:51:22 -0600
commit262937ff6e505bbf86d15500279ff23398f9e1c8 (patch)
tree66084a1e14ed86f19982b800f60d332c139c8a36 /lib/puppet/network
parentb800bde30bd5a08f5e222725588062e2bca37a79 (diff)
downloadpuppet-262937ff6e505bbf86d15500279ff23398f9e1c8.tar.gz
puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.tar.xz
puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.zip
Correctly handling URI escaping throughout the REST process
This means, at the least, that we can now serve files via REST when they have spaces and other weird characters in their names. This involves a small change to many files. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/network')
-rw-r--r--lib/puppet/network/http/handler.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index 9bc94a037..cce679864 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -75,6 +75,7 @@ module Puppet::Network::HTTP::Handler
# Execute our find.
def do_find(request, response)
key = request_key(request) || raise(ArgumentError, "Could not locate lookup key in request path [#{path(request)}]")
+ key = URI.unescape(key)
args = params(request)
unless result = model.find(key, args)
return do_exception(response, "Could not find %s %s" % [model.name, key], 404)
@@ -93,6 +94,7 @@ module Puppet::Network::HTTP::Handler
def do_search(request, response)
args = params(request)
if key = request_key(request)
+ key = URI.unescape(key)
result = model.search(key, args)
else
result = model.search(args)
@@ -110,6 +112,7 @@ module Puppet::Network::HTTP::Handler
# Execute our destroy.
def do_destroy(request, response)
key = request_key(request) || raise(ArgumentError, "Could not locate lookup key in request path [#{path(request)}]")
+ key = URI.unescape(key)
args = params(request)
result = model.destroy(key, args)