mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-08 16:41:00 +00:00
Allow both redirection www.example.com -> example.com and vice versa.
This commit is contained in:
parent
280b7892ef
commit
57ffa6bf97
1 changed files with 3 additions and 1 deletions
|
|
@ -52,6 +52,8 @@ class InternPatternUrl (urlbase.UrlBase):
|
|||
args = list(re.escape(x) for x in (scheme, domain, path))
|
||||
if args[0] in ('http', 'https'):
|
||||
args[0] = 'https?'
|
||||
# allow redirection www.example.com -> example.com and vice versa
|
||||
if args[1].startswith('www\\.'):
|
||||
args[1] = r"(www\.|)%s" % args[1][5:]
|
||||
args[1] = args[1][5:]
|
||||
args[1] = r"(www\.|)%s" % args[1]
|
||||
return "%s://%s%s" % tuple(args)
|
||||
|
|
|
|||
Loading…
Reference in a new issue