mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority (GH-113563)
This commit is contained in:
parent
e04cd964eb
commit
e237b25a4f
3 changed files with 70 additions and 4 deletions
|
@ -525,7 +525,7 @@ def urlunsplit(components):
|
|||
empty query; the RFC states that these are equivalent)."""
|
||||
scheme, netloc, url, query, fragment, _coerce_result = (
|
||||
_coerce_args(*components))
|
||||
if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):
|
||||
if netloc or (scheme and scheme in uses_netloc) or url[:2] == '//':
|
||||
if url and url[:1] != '/': url = '/' + url
|
||||
url = '//' + (netloc or '') + url
|
||||
if scheme:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue