Skip to content

Commit

Permalink
tweak common.DOMAIN_RE to avoid exponential backtracking
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Dec 2, 2024
1 parent f6be83f commit 23e0323
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# https://stackoverflow.com/questions/10306690/what-is-a-regular-expression-which-will-match-a-valid-domain-name-without-a-subd
#
# TODO: preprocess with domain2idna, then narrow this to just [a-z0-9-]
DOMAIN_RE = r'^([^/:;@?!\']+\.)+[^/:@_?!\']+$'
DOMAIN_RE = r'^([^/:;@?!\'.]+\.)+[^/:@_?!\'.]+$'

CONTENT_TYPE_HTML = 'text/html; charset=utf-8'

Expand Down

0 comments on commit 23e0323

Please sign in to comment.