mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Fix Issue9721 - urljoin behavior when the relative url starts with ';'
This commit is contained in:
parent
b25a791802
commit
dca5b86233
3 changed files with 7 additions and 7 deletions
|
@ -411,14 +411,9 @@ def urljoin(base, url, allow_fragments=True):
|
|||
if path[:1] == '/':
|
||||
return _coerce_result(urlunparse((scheme, netloc, path,
|
||||
params, query, fragment)))
|
||||
if not path:
|
||||
if not path and not params:
|
||||
path = bpath
|
||||
if not params:
|
||||
params = bparams
|
||||
else:
|
||||
path = path[:-1]
|
||||
return _coerce_result(urlunparse((scheme, netloc, path,
|
||||
params, query, fragment)))
|
||||
params = bparams
|
||||
if not query:
|
||||
query = bquery
|
||||
return _coerce_result(urlunparse((scheme, netloc, path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue