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
This commit is contained in:
parent
029c2782dd
commit
c84a3c4d96
@ -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:
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user