Skip to content

Commit d28df40

Browse files
committed
Allow percent-encoded bytes in host
1 parent 2299e27 commit d28df40

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/rfc3986/abnf_regexp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
# Host patterns, see: http://tools.ietf.org/html/rfc3986#section-3.2.2
7373
# The pattern for a regular name, e.g., www.google.com, api.github.com
74-
REGULAR_NAME_RE = REG_NAME = '(({0})*|[{1}]*)'.format(
74+
REGULAR_NAME_RE = REG_NAME = '((?:{0}|[{1}])*)'.format(
7575
'%[0-9A-Fa-f]{2}', SUB_DELIMITERS_RE + UNRESERVED_RE
7676
)
7777
# The pattern for an IPv4 address, e.g., 192.168.255.255, 127.0.0.1,

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'www.example.com',
2424
'localhost',
2525
'http-bin.org',
26+
'%2Fvar%2Frun%2Fsocket'
2627
]
2728

2829
invalid_hosts = [

0 commit comments

Comments
 (0)