mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Sjoerd Mullender:
In splithost, accept empty host part in URLs. This is required for file URLs that can have an empty host part. For such URLs, we should not return the initial 2 slashes as part of the file name.
This commit is contained in:
parent
e4694eba0f
commit
3427c1f71b
1 changed files with 1 additions and 1 deletions
|
|
@ -773,7 +773,7 @@ def splithost(url):
|
|||
global _hostprog
|
||||
if _hostprog is None:
|
||||
import re
|
||||
_hostprog = re.compile('^//([^/]+)(.*)$')
|
||||
_hostprog = re.compile('^//([^/]*)(.*)$')
|
||||
|
||||
match = _hostprog.match(url)
|
||||
if match: return match.group(1, 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue