mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619)
Ignore leading dots and no longer ignore a trailing newline.
This commit is contained in:
parent
ec007cb43f
commit
6a265f0d0c
4 changed files with 39 additions and 13 deletions
|
@ -1056,9 +1056,9 @@ def _splitport(host):
|
|||
"""splitport('host:port') --> 'host', 'port'."""
|
||||
global _portprog
|
||||
if _portprog is None:
|
||||
_portprog = re.compile('(.*):([0-9]*)$', re.DOTALL)
|
||||
_portprog = re.compile('(.*):([0-9]*)', re.DOTALL)
|
||||
|
||||
match = _portprog.match(host)
|
||||
match = _portprog.fullmatch(host)
|
||||
if match:
|
||||
host, port = match.groups()
|
||||
if port:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue