You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QUERY_STRING is an optional argument for environ, hence should probably be accessed using get. Moreover, I think exceptions should not be just pass-ed. Currently, if QUERY_STRING is absent, KeyError will result in request be equal to {} which will throw another exception when we try to access headers.
Valid for both python2 and python3
python2/raygun4py/middleware/wsgi.py:
try:
request = {
'httpMethod': environ['REQUEST_METHOD'],
'url': environ['PATH_INFO'],
'ipAddress': environ['REMOTE_ADDR'],
'hostName': environ['HTTP_HOST'].replace(' ', ''),
'queryString': environ['QUERY_STRING'],
'headers': {},
'form': {},
'rawData': {}
}
except Exception:
pass
for key, value in environ.items():
if key.startswith('HTTP_'):
request['headers'][key] = value
The text was updated successfully, but these errors were encountered:
QUERY_STRING
is an optional argument forenviron
, hence should probably be accessed usingget
. Moreover, I think exceptions should not be justpass
-ed. Currently, ifQUERY_STRING
is absent,KeyError
will result inrequest
be equal to{}
which will throw another exception when we try to accessheaders
.Valid for both
python2
andpython3
python2/raygun4py/middleware/wsgi.py
:The text was updated successfully, but these errors were encountered: