Intern patterns now accept URLs with and without "www." prefixes

as default. This allows sites to check that use both variants.


git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3714 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2008-04-21 09:18:58 +00:00
parent e73e5396d6
commit df857aab8d
2 changed files with 7 additions and 0 deletions

View file

@ -40,6 +40,11 @@
Changed: linkcheck/director/__init__.py
Closes: SF bug #1720104
* Intern patterns now accept URLs with and without "www." prefixes
as default. This allows sites to check that use both variants.
Type: feature
Changed: linkcheck/checker/internpaturl.py
4.8 "Hallam Foe" (released 16.12.2007)
* Fix message typo for not disclosing information.

View file

@ -51,4 +51,6 @@ class InternPatternUrl (urlbase.UrlBase):
args = list(re.escape(x) for x in (scheme, domain, path))
if args[0] in ('http', 'https'):
args[0] = 'https?'
if args[1].startswith('www\\.'):
args[1] = r"(www\.|)%s" % args[1][5:]
return "%s://%s%s" % tuple(args)