4๐
โ
os.environ['PATH_INFO']
is decoded, so you lose that information. Probably os.environ['REQUEST_URI']
is available, and if it is available it is not decoded. Django only reads PATH_INFO. You could probably do something like:
request_uri = environ['REQUEST_URI']
request_uri = re.sub(r'%2f', '****', request_uri, re.I)
environ['PATH_INFO'] = urllib.unquote(request_uri)
Then all cases of %2f are replaced with ****
(or whatever you want to use).
๐คIan Bicking
Source:stackexchange.com