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
But path includes the root_path, while the WSGI spec (PEP 3333) says:
SCRIPT_NAME
The initial portion of the request URL’s “path” that corresponds to the application object, so that the application knows its virtual “location”. This may be an empty string, if the application corresponds to the “root” of the server. PATH_INFO
The remainder of the request URL’s “path”, designating the virtual “location” of the request’s target within the application. This may be an empty string, if the request URL targets the application root and does not have a trailing slash.
See also #424 and especially this comment by @tiangolo for background.
PATH_INFO
seems to be set incorrectly byWsgiToAsgiInstance.build_environ()
. Currently, it's just copied over from thepath
ASGI scope:asgiref/asgiref/wsgi.py
Lines 57 to 70 in 8cf847a
But
path
includes theroot_path
, while the WSGI spec (PEP 3333) says:A holdover from the CGI spec (RFC 3875).
When starlette fixed their path handling, they changed their WSGI adapter to account for that:
https://github.com/encode/starlette/blob/7533b61a34f8b0dcb5fc35c717d458439f0baf18/starlette/middleware/wsgi.py#L24-L42
I think asgiref's adapter should do the same.
The text was updated successfully, but these errors were encountered: