System image: fishnchips
Python version: 3.8
def application(wsgienv,starter):
starter('200 OK',[('transfer-encoding','chunked')])
for k,v in wsgienv.items():
yield f'{k}: {v!r}\r\n'.encode('utf8')
It is a simple code to show received request.
Make a request:
curl "https://<web app host>/test/%E4%B8%AD%E6%96%87?query=%E6%97%A5%E6%9C%AC%E8%AA%9E"
will get such response:
QUERY_STRING: 'query=%E6%97%A5%E6%9C%AC%E8%AA%9E'
REQUEST_URI: '/test/%E4%B8%AD%E6%96%87?query=%E6%97%A5%E6%9C%AC%E8%AA%9E'
PATH_INFO: '/test/ä¸\xadæ\x96\x87'
...
Here is the question:
Why the 'PATH_INFO' has different value with the path part of 'REQUEST_URI'?
Is there a way to config my account to make 'PATH_INFO' show the percent-encoded path, or just use
urllib.parse.urlsplit(wsgienv['REQUEST_URI'])
and forget the 'PATH_INFO'?