WSGI 'PATH_INFO' should be URL unquoted (#1391)

This commit is contained in:
Tom Christie 2020-11-16 09:39:51 +00:00 committed by GitHub
parent 0af6d9a254
commit 2961f267fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import io
import itertools
import typing
from urllib.parse import unquote
import httpcore
@ -83,7 +84,7 @@ class WSGITransport(httpcore.SyncHTTPTransport):
"wsgi.run_once": False,
"REQUEST_METHOD": method.decode(),
"SCRIPT_NAME": self.script_name,
"PATH_INFO": path.decode("ascii"),
"PATH_INFO": unquote(path.decode("ascii")),
"QUERY_STRING": query.decode("ascii"),
"SERVER_NAME": host.decode("ascii"),
"SERVER_PORT": str(port),