Remix.run Logo
Joker_vD 3 hours 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 2 hours ago | parent | next [-]

https://docs.python.org/3/library/urllib.parse.html

Joker_vD 20 minutes ago | parent [-]

Yep, 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.

21 minutes ago | parent | prev | next [-]
[deleted]
teh64 an hour ago | parent | prev [-]

[dead]