python - How can I receive percent encoded slashes with Django on App Engine? -


I am using Django with Google's App Engine.

I want to send a notification to the server with a request such as the percentage encoded slash http: / localhost / turtle / waxy% 2Fsmooth such as URL to r '^ / turtuz / ( ? P & lt; type & gt; ([A-Za-z] |% 2F) +) $ '. The request server is retained, but compared to earlier than it has been compared to regex,% 2F is converted to forward slash.

What can I do to prevent% 2Fs from being converted to a forward slash? Thanks!

os.environ ['pathhimpho'] has been decoded, So you lose that information, maybe os.environment ['REQUEST_URI'] is available, and if it is available it is not a decode. Django reads only PATH_INFO: You may do something like this:

  request_uri = environ ['REQUEST_URI'] request_uri = re.sub ('% 2f', '****' , Request_yuri, again I) Environ ['PATH_INFO'] = urllib.unquote (request_uri)  

Then all cases of% 2f from **** Has been changed (or use whatever you want).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -