Merge "operation_log: add QUERY_STRING to request_url"

This commit is contained in:
Zuul 2018-03-28 20:15:03 +00:00 committed by Gerrit Code Review
commit 9135dde8df

View File

@ -148,6 +148,9 @@ class OperationLogMiddleware(object):
referer_url = referer_url.decode('utf-8')
except Exception:
pass
request_url = urlparse.unquote(request.path)
if request.META['QUERY_STRING']:
request_url += '?' + request.META['QUERY_STRING']
return {
'client_ip': request.META.get('REMOTE_ADDR', None),
'domain_name': getattr(user, 'domain_name', None),
@ -158,7 +161,7 @@ class OperationLogMiddleware(object):
'user_id': request.session.get('user_id', None),
'request_scheme': request.scheme,
'referer_url': referer_url,
'request_url': urlparse.unquote(request.path),
'request_url': request_url,
'method': request.method if not exception else None,
'param': self._get_request_param(request),
}