Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/validators/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def _validate_optionals(path: str, query: str, fragment: str, strict_query: bool
optional_segments &= True
if fragment:
# See RFC3986 Section 3.5 Fragment for allowed characters
# Adding "#", see https://github.com/python-validators/validators/issues/403
optional_segments &= bool(
re.fullmatch(r"[0-9a-z?/:@\-._~%!$&'()*+,;=]*", fragment, re.IGNORECASE)
re.fullmatch(r"[0-9a-z?/:@\-._~%!$&'()*+,;=#]*", fragment, re.IGNORECASE)
)
return optional_segments

Expand Down
Loading