General

Bernhard R. Link: I learned something new about URLs today

Today I stumbled over some behavior that I found quite surprising: $ ipython3 -c 'import httpx;print(httpx.URL("https://example.com/foo/bar/../../baz"))' https://example.com/baz Even more surprising that behavior is actually standards-compliant, even mandated by RFC 3986. The underlying motivation is relative reverences. If some resource reachable by "https://example.com/foo/bar" references another resource relatively as "../../baz" then this is of course the intended result. Getting from this problem to what RFC 3986 suggests might be surprising in the result, but somewhat understandable if you look at the consequences…

Quelle: Originalartikel öffnen

AI Assistant
Context loaded: Bernhard R. Link: I learned something new about URLs today