summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/acls_endpoint.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2014-07-24 07:03:28 -0600
committerJohn Keiser <jkeiser@opscode.com>2014-08-22 09:20:48 -0700
commitf14e184bb5fa4de5bea75b10a0d525a5fde6b474 (patch)
treeb1462942fb3865e7fa6e666c6254e921033bc2da /lib/chef_zero/endpoints/acls_endpoint.rb
parent9a443988b73b53238e1ad82a2d0330c72bc869f2 (diff)
downloadchef-zero-f14e184bb5fa4de5bea75b10a0d525a5fde6b474.tar.gz
Make _acl wrong method raise 404 instead of 405
Diffstat (limited to 'lib/chef_zero/endpoints/acls_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/acls_endpoint.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/chef_zero/endpoints/acls_endpoint.rb b/lib/chef_zero/endpoints/acls_endpoint.rb
index 16248c2..9208a6d 100644
--- a/lib/chef_zero/endpoints/acls_endpoint.rb
+++ b/lib/chef_zero/endpoints/acls_endpoint.rb
@@ -16,6 +16,19 @@ module ChefZero
acls = DataNormalizer.normalize_acls(get_acls(request, path), request.requestor)
json_response(200, acls)
end
+
+ # Remove these to get them doing 405 again like they ought to
+ def put(request)
+ raise RestErrorResponse.new(404, "Method not allowed: POST #{build_uri(request.base_uri, request.rest_path)}")
+ end
+
+ def post(request)
+ raise RestErrorResponse.new(404, "Method not allowed: POST #{build_uri(request.base_uri, request.rest_path)}")
+ end
+
+ def delete(request)
+ raise RestErrorResponse.new(404, "Method not allowed: DELETE #{build_uri(request.base_uri, request.rest_path)}")
+ end
end
end
end