summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/network')
-rw-r--r--lib/puppet/network/http/api/v1.rb4
-rw-r--r--lib/puppet/network/http/rack/rest.rb4
-rwxr-xr-xlib/puppet/network/rights.rb2
3 files changed, 4 insertions, 6 deletions
diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb
index 4b7c15a36..dcb0e0a22 100644
--- a/lib/puppet/network/http/api/v1.rb
+++ b/lib/puppet/network/http/api/v1.rb
@@ -63,9 +63,9 @@ module Puppet::Network::HTTP::API::V1
return :singular if indirection == "status"
return :plural if indirection == "inventory"
- result = (indirection =~ /s$/) ? :plural : :singular
+ result = (indirection =~ /s$|_search$/) ? :plural : :singular
- indirection.sub!(/s$/, '') if result
+ indirection.sub!(/s$|_search$|es$/, '')
result
end
diff --git a/lib/puppet/network/http/rack/rest.rb b/lib/puppet/network/http/rack/rest.rb
index b7e1d9709..602927a78 100644
--- a/lib/puppet/network/http/rack/rest.rb
+++ b/lib/puppet/network/http/rack/rest.rb
@@ -76,9 +76,7 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler
# request.body has some limitiations, so we need to concat it back
# into a regular string, which is something puppet can use.
def body(request)
- body = ''
- request.body.each { |part| body += part }
- body
+ request.body.read
end
def extract_client_info(request)
diff --git a/lib/puppet/network/rights.rb b/lib/puppet/network/rights.rb
index 56af53983..6fde181c9 100755
--- a/lib/puppet/network/rights.rb
+++ b/lib/puppet/network/rights.rb
@@ -83,7 +83,7 @@ class Rights
else
# there were no rights allowing/denying name
# if name is not a path, let's throw
- raise ArgumentError.new "Unknown namespace right '#{name}'"
+ raise ArgumentError, "Unknown namespace right '#{name}'"
end
error
end