3 ms·
I don't believe Python's urllib has a function that takes what HTTP terms an "origin-form" (an absolute path with possibly a query attached to it with "?") and
by Joker_vD 5mo ago
I don't believe Python's urllib has a function that takes what HTTP terms an "origin-form" (an absolute path with possibly a query attached to it with "?") and parses it apart.
Still, the RFC 9112 that defines HTTP/1.1 basics requires that, for the purposes of URI reconstruction, "if there is no Host header field or if its field value is empty or invalid, the target URI's authority component is empty."
- hft 5mo agohttps://docs.python.org/3/library/urllib.parse.html https://docs.python.org/3/library/urllib.parse.html
- Joker_vD 5mo agoYep, none of them are suitable for this use case; you need to validate the Host header first and reconstruct the URI first before parsing it.
- teh64 5mo ago[dead]
- deleted 5mo ago[deleted]