summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index fd6fc36..02f9626 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -889,10 +889,10 @@ class HTTPPasswordMgr:
return True
if base[0] != test[0]:
return False
- common = posixpath.commonprefix((base[1], test[1]))
- if len(common) == len(base[1]):
- return True
- return False
+ prefix = base[1]
+ if prefix[-1:] != '/':
+ prefix += '/'
+ return test[1].startswith(prefix)
class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr):