mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-08 08:30:59 +00:00
replace empty paths with a slash
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@433 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
c87487ce09
commit
3675c1ebef
1 changed files with 11 additions and 2 deletions
|
|
@ -28,6 +28,17 @@ class HttpUrlData (UrlData):
|
|||
"Url link with http scheme"
|
||||
netscape_re = re.compile("Netscape-Enterprise/")
|
||||
|
||||
def buildUrl (self):
|
||||
UrlData.buildUrl(self)
|
||||
if not self.urlTuple[2]:
|
||||
self.setWarning(linkcheck._("Path is empty"))
|
||||
self.urlTuple = (self.urlTuple[0], self.urlTuple[1], "/",
|
||||
self.urlTuple[3], self.urlTuple[4], self.urlTuple[5])
|
||||
self.url = urlparse.urlunparse(self.urlTuple)
|
||||
# resolve HTML entities
|
||||
self.url = StringUtil.unhtmlify(self.url)
|
||||
|
||||
|
||||
def checkConnection (self):
|
||||
"""
|
||||
Check a URL with HTTP protocol.
|
||||
|
|
@ -75,8 +86,6 @@ class HttpUrlData (UrlData):
|
|||
self.auth = None
|
||||
self.proxyauth = None
|
||||
self.cookies = []
|
||||
if not self.urlTuple[2]:
|
||||
self.setWarning(linkcheck._("Missing '/' at end of URL"))
|
||||
if self.config["robotstxt"] and not self.robotsTxtAllowsUrl():
|
||||
self.setWarning(linkcheck._("Access denied by robots.txt, checked only syntax"))
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue