Merge "Stop digging for publicly_accessible ourselves"

This commit is contained in:
Jenkins 2016-07-05 14:15:28 +00:00 committed by Gerrit Code Review
commit 9f4a662296
2 changed files with 6 additions and 7 deletions

View File

@ -1055,8 +1055,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:

View File

@ -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,