From 3675c1ebef453f9b245b2a9bf87f4c8e9d30b9d8 Mon Sep 17 00:00:00 2001 From: calvin Date: Tue, 14 May 2002 20:44:59 +0000 Subject: [PATCH] replace empty paths with a slash git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@433 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/HttpUrlData.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/linkcheck/HttpUrlData.py b/linkcheck/HttpUrlData.py index 50190b8c..3db0fb98 100644 --- a/linkcheck/HttpUrlData.py +++ b/linkcheck/HttpUrlData.py @@ -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