mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix SF bug [ #416231 ] urllib.basejoin fails to apply some ../.
Reported by Juan M. Bello Rivas.
This commit is contained in:
parent
9c7eab82b3
commit
b8bf3bece2
1 changed files with 2 additions and 0 deletions
|
@ -863,6 +863,8 @@ def basejoin(base, url):
|
|||
basepath = ''
|
||||
|
||||
path = basepath + path
|
||||
if host and path and path[0] != '/':
|
||||
path = '/' + path
|
||||
if type and host: return type + '://' + host + path
|
||||
elif type: return type + ':' + path
|
||||
elif host: return '//' + host + path # don't know what this means
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue