From c84a3c4d967a2951da50b395445e4a282b9debc4 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Thu, 30 Jun 2016 15:28:24 -0700 Subject: [PATCH] Stop digging for publicly_accessible ourselves Also, make request method calling in obj.server consistent with change 3944d8 to account & container Change-Id: I893d77a06793a5eeafac203a45971e96425afb96 Related-Change: I2f7586f96b41a97e6ae254efc83218b3b5c6cc9e --- swift/obj/server.py | 3 +-- swift/proxy/server.py | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/swift/obj/server.py b/swift/obj/server.py index b9c8616124..8967684b35 100644 --- a/swift/obj/server.py +++ b/swift/obj/server.py @@ -1034,8 +1034,7 @@ class ObjectController(BaseStorageServer): if req.method not in self.allowed_methods: res = HTTPMethodNotAllowed() else: - method = getattr(self, req.method) - res = method(req) + res = getattr(self, req.method)(req) except DiskFileCollision: res = HTTPForbidden(request=req) except HTTPException as error_response: diff --git a/swift/proxy/server.py b/swift/proxy/server.py index 99b99afd54..9b89498c53 100644 --- a/swift/proxy/server.py +++ b/swift/proxy/server.py @@ -383,11 +383,11 @@ class Application(object): controller.trans_id = req.environ['swift.trans_id'] self.logger.client_ip = get_remote_client(req) - handler = getattr(controller, req.method, None) - if not getattr(handler, 'publicly_accessible', False): - allowed_methods = getattr(controller, 'allowed_methods', set()) - return HTTPMethodNotAllowed( - request=req, headers={'Allow': ', '.join(allowed_methods)}) + if req.method not in controller.allowed_methods: + return HTTPMethodNotAllowed(request=req, headers={ + 'Allow': ', '.join(controller.allowed_methods)}) + handler = getattr(controller, req.method) + old_authorize = None if 'swift.authorize' in req.environ: # We call authorize before the handler, always. If authorized,