diff --git a/src/rfc3986/abnf_regexp.py b/src/rfc3986/abnf_regexp.py index 5852e4d..ba062b3 100644 --- a/src/rfc3986/abnf_regexp.py +++ b/src/rfc3986/abnf_regexp.py @@ -27,7 +27,7 @@ ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" DIGIT = "0123456789" # https://tools.ietf.org/html/rfc3986#section-2.3 -UNRESERVED = UNRESERVED_CHARS = ALPHA + DIGIT + r"._!-" +UNRESERVED = UNRESERVED_CHARS = ALPHA + DIGIT + r'._!-~' UNRESERVED_CHARS_SET = set(UNRESERVED_CHARS) NON_PCT_ENCODED_SET = RESERVED_CHARS_SET.union(UNRESERVED_CHARS_SET) # We need to escape the '-' in this case: diff --git a/tests/test_normalizers.py b/tests/test_normalizers.py index 1dbd6fa..eff650c 100644 --- a/tests/test_normalizers.py +++ b/tests/test_normalizers.py @@ -97,6 +97,7 @@ def test_fragment_normalization(): ["component", "encoded_component"], [ ("/%", "/%25"), + ("/~", "/~"), ("/%a", "/%25a"), ("/%ag", "/%25ag"), ("/%af", "/%af"),