mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-11 18:10:58 +00:00
bla
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@122 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
b4a94ac384
commit
86fc8ec652
4 changed files with 8 additions and 4 deletions
|
|
@ -96,7 +96,9 @@ class Configuration(UserDict.UserDict):
|
|||
self.data["externlinks"] = []
|
||||
self.data["internlinks"] = []
|
||||
self.data["allowdeny"] = 0
|
||||
self.data["authentication"] = []
|
||||
self.data["authentication"] = [(re.compile(r'^.+$'),
|
||||
'anonymous',
|
||||
'joe@')]
|
||||
self.data["proxy"] = 0
|
||||
self.data["proxyport"] = 8080
|
||||
self.data["recursionlevel"] = 1
|
||||
|
|
@ -475,7 +477,6 @@ class Configuration(UserDict.UserDict):
|
|||
self.data["authentication"].append(tuple)
|
||||
i = i + 1
|
||||
except ConfigParser.Error: pass
|
||||
self.data["authentication"].append((re.compile(".*"), "anonymous", "guest@"))
|
||||
|
||||
section = "filtering"
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ class FtpUrlData(UrlData):
|
|||
|
||||
def checkConnection(self, config):
|
||||
_user, _password = self._getUserPassword(config)
|
||||
if _user is None or _password is None:
|
||||
raise linkcheck.error, _("No user or password found")
|
||||
self.urlConnection = ftplib.FTP(self.urlTuple[1], _user, _password)
|
||||
info = self.urlConnection.getwelcome()
|
||||
if not info:
|
||||
|
|
|
|||
|
|
@ -97,11 +97,11 @@ class HttpUrlData(UrlData):
|
|||
import base64,string
|
||||
_user, _password = self._getUserPassword(config)
|
||||
self.auth = "Basic "+\
|
||||
string.strip(base64.encodestring(_user+":"+_password))
|
||||
base64.encodestring("%s:%s" % (_user, _password))
|
||||
status, statusText, self.mime = self._getHttpRequest()
|
||||
Config.debug("DEBUG: Authentication "+_user+"/"+_password+"\n")
|
||||
|
||||
# Netscape Enterprise Server returns errors with HEAD
|
||||
# Netscape Enterprise Server 3 returns errors with HEAD
|
||||
# request, but valid urls with GET request. Bummer!
|
||||
elif status>=400 and self.mime:
|
||||
server = self.mime.getheader("Server")
|
||||
|
|
|
|||
|
|
@ -353,6 +353,7 @@ class UrlData:
|
|||
for rx, user, password in config["authentication"]:
|
||||
if rx.match(self.url):
|
||||
return user, password
|
||||
return None,None
|
||||
|
||||
|
||||
from FileUrlData import FileUrlData
|
||||
|
|
|
|||
Loading…
Reference in a new issue