Handling URL components #1222
Unanswered
scollinson
asked this question in
Potential Issue
Replies: 1 comment
-
I think that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While trying to create a basic HTTP proxy with starlette and uvicorn I've run into an interesting issue. I'm not sure if it's a problem with uvicorn or ASGI itself.
The first thing I noticed was that uvicorn does not correctly handle the h11 request target when using it to create the scope
path
andraw_path
variables. The h11Request.target
value is documented to have several forms as per https://datatracker.ietf.org/doc/html/rfc7230#section-5.3 and uvicorn only appears to handle theorigin-form
request target.I updated
h11_impl.py
to useurllib.parse.urlparse
onevent.target
to split out the host from the path, but noticed that the ASGI scope only stores thepath
andquery_string
and ignores path fragments and parameters. Is that intended? It seems like you'd not be able to reconstruct the complete query URL with the information supplied in the scope.Beta Was this translation helpful? Give feedback.
All reactions