Skip to content

Commit b8bf3be

Browse files
committed
Fix SF bug [ #416231 ] urllib.basejoin fails to apply some ../.
Reported by Juan M. Bello Rivas.
1 parent 9c7eab8 commit b8bf3be

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/urllib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,8 @@ def basejoin(base, url):
863863
basepath = ''
864864

865865
path = basepath + path
866+
if host and path and path[0] != '/':
867+
path = '/' + path
866868
if type and host: return type + '://' + host + path
867869
elif type: return type + ':' + path
868870
elif host: return '//' + host + path # don't know what this means

0 commit comments

Comments
 (0)