Skip to content

Commit dba3ada

Browse files
authored
Merge pull request #74 from valiant1x/master
Include `~` as unreserved character
2 parents 0baac58 + fd01b27 commit dba3ada

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
@@ -27,7 +27,7 @@
2727
ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
2828
DIGIT = "0123456789"
2929
# https://tools.ietf.org/html/rfc3986#section-2.3
30-
UNRESERVED = UNRESERVED_CHARS = ALPHA + DIGIT + r"._!-"
30+
UNRESERVED = UNRESERVED_CHARS = ALPHA + DIGIT + r'._!-~'
3131
UNRESERVED_CHARS_SET = set(UNRESERVED_CHARS)
3232
NON_PCT_ENCODED_SET = RESERVED_CHARS_SET.union(UNRESERVED_CHARS_SET)
3333
# We need to escape the '-' in this case:

tests/test_normalizers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def test_fragment_normalization():
9797
["component", "encoded_component"],
9898
[
9999
("/%", "/%25"),
100+
("/~", "/~"),
100101
("/%a", "/%25a"),
101102
("/%ag", "/%25ag"),
102103
("/%af", "/%af"),

0 commit comments

Comments
 (0)