Merge "Move calls to self.app outside of error handling"
This commit is contained in:
@@ -225,7 +225,10 @@ class ServerSideCopyMiddleware(object):
|
|||||||
req = Request(env)
|
req = Request(env)
|
||||||
try:
|
try:
|
||||||
(version, account, container, obj) = req.split_path(4, 4, True)
|
(version, account, container, obj) = req.split_path(4, 4, True)
|
||||||
|
is_obj_req = True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
is_obj_req = False
|
||||||
|
if not is_obj_req:
|
||||||
# If obj component is not present in req, do not proceed further.
|
# If obj component is not present in req, do not proceed further.
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
|
@@ -433,7 +433,10 @@ class Decrypter(object):
|
|||||||
req = Request(env)
|
req = Request(env)
|
||||||
try:
|
try:
|
||||||
parts = req.split_path(3, 4, True)
|
parts = req.split_path(3, 4, True)
|
||||||
|
is_cont_or_obj_req = True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
is_cont_or_obj_req = False
|
||||||
|
if not is_cont_or_obj_req:
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
if parts[3] and req.method in ('GET', 'HEAD'):
|
if parts[3] and req.method in ('GET', 'HEAD'):
|
||||||
|
@@ -420,7 +420,10 @@ class DynamicLargeObject(object):
|
|||||||
req = Request(env)
|
req = Request(env)
|
||||||
try:
|
try:
|
||||||
vrs, account, container, obj = req.split_path(4, 4, True)
|
vrs, account, container, obj = req.split_path(4, 4, True)
|
||||||
|
is_obj_req = True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
is_obj_req = False
|
||||||
|
if not is_obj_req:
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
if ((req.method == 'GET' or req.method == 'HEAD') and
|
if ((req.method == 'GET' or req.method == 'HEAD') and
|
||||||
|
@@ -128,6 +128,10 @@ class ListingFilter(object):
|
|||||||
# account and container only
|
# account and container only
|
||||||
version, acct, cont = req.split_path(2, 3)
|
version, acct, cont = req.split_path(2, 3)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
is_container_req = False
|
||||||
|
else:
|
||||||
|
is_container_req = True
|
||||||
|
if not is_container_req:
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
if not valid_api_version(version) or req.method not in ('GET', 'HEAD'):
|
if not valid_api_version(version) or req.method not in ('GET', 'HEAD'):
|
||||||
|
@@ -119,7 +119,11 @@ class ListingEtagMiddleware(object):
|
|||||||
if not valid_api_version(v):
|
if not valid_api_version(v):
|
||||||
raise ValueError
|
raise ValueError
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# not a container request; pass through
|
is_container_req = False
|
||||||
|
else:
|
||||||
|
is_container_req = True
|
||||||
|
if not is_container_req:
|
||||||
|
# pass through
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
ctx = WSGIContext(self.app)
|
ctx = WSGIContext(self.app)
|
||||||
|
@@ -1511,7 +1511,10 @@ class StaticLargeObject(object):
|
|||||||
req = Request(env)
|
req = Request(env)
|
||||||
try:
|
try:
|
||||||
vrs, account, container, obj = req.split_path(3, 4, True)
|
vrs, account, container, obj = req.split_path(3, 4, True)
|
||||||
|
is_cont_or_obj_req = True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
is_cont_or_obj_req = False
|
||||||
|
if not is_cont_or_obj_req:
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
if not obj:
|
if not obj:
|
||||||
|
@@ -551,7 +551,10 @@ class SymlinkMiddleware(object):
|
|||||||
req = Request(env)
|
req = Request(env)
|
||||||
try:
|
try:
|
||||||
version, acc, cont, obj = req.split_path(3, 4, True)
|
version, acc, cont, obj = req.split_path(3, 4, True)
|
||||||
|
is_cont_or_obj_req = True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
is_cont_or_obj_req = False
|
||||||
|
if not is_cont_or_obj_req:
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@@ -814,7 +814,10 @@ class VersionedWritesMiddleware(object):
|
|||||||
req = Request(env)
|
req = Request(env)
|
||||||
try:
|
try:
|
||||||
(api_version, account, container, obj) = req.split_path(3, 4, True)
|
(api_version, account, container, obj) = req.split_path(3, 4, True)
|
||||||
|
is_cont_or_obj_req = True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
is_cont_or_obj_req = False
|
||||||
|
if not is_cont_or_obj_req:
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
# In case allow_versioned_writes is set in the filter configuration,
|
# In case allow_versioned_writes is set in the filter configuration,
|
||||||
|
Reference in New Issue
Block a user