◐ Shell
clean mode source ↗

gh-87389: avoid treating path as URI with netloc by nascheme · Pull Request #93894 · python/cpython

still needs test for urlunsplit() change

gpshead

@nascheme nascheme changed the title gh-87389: alternative fix, WIP gh-87389: avoid treating path as URI with netloc

Jun 16, 2022
The pathsplit() function will work correctly on relative paths too so
don't say "absolute paths".  Improve comment for _get_redirect_url().

gpshead

This avoids "manual parsing" of the Request-URI part of the request and
matches what _get_redirect_url() does.
Possible that someone could override this so a method is nicer.
Since pathsplit() doesn't seem like a generally useful public API,
remove it.  Instead, add a _request_path_split() method.  This ensures
that the redirect logic and the translate_path() method use the same
path parsing.

@gpshead

vadmium

@serhiy-storchaka

@serhiy-storchaka