mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
Check for missing environ in request
This commit is contained in:
@@ -178,7 +178,7 @@ class URLModificationMiddleware(object):
|
|||||||
return '/'.join(url_units)
|
return '/'.join(url_units)
|
||||||
|
|
||||||
def process_request(self, request):
|
def process_request(self, request):
|
||||||
if 'REQUEST_URI' in request.environ:
|
if hasattr(request, 'environ') and 'REQUEST_URI' in request.environ:
|
||||||
old_path = six.moves.urllib.parse.urlsplit(request.environ['REQUEST_URI']).path
|
old_path = six.moves.urllib.parse.urlsplit(request.environ['REQUEST_URI']).path
|
||||||
old_path = old_path[request.path.find(request.path_info):]
|
old_path = old_path[request.path.find(request.path_info):]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user