mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-19 13:51:01 +00:00
Proper proxy type check.
This commit is contained in:
parent
4c15fc6a8b
commit
e99c55f6c4
1 changed files with 1 additions and 1 deletions
|
|
@ -36,13 +36,13 @@ class ProxySupport (object):
|
|||
if not self.proxy:
|
||||
return
|
||||
proxyargs = {"proxy": self.proxy}
|
||||
self.proxytype, self.proxy = urllib.splittype(self.proxy)
|
||||
if self.proxytype not in ('http', 'https'):
|
||||
# Note that invalid proxies might raise TypeError in urllib2,
|
||||
# so make sure to stop checking at this point, not later.
|
||||
msg = _("Proxy value `%(proxy)s' must start with 'http:' or 'https:'.") \
|
||||
% proxyargs
|
||||
raise LinkCheckerError(msg)
|
||||
self.proxytype, self.proxy = urllib.splittype(self.proxy)
|
||||
self.proxy = urllib.splithost(self.proxy)[0]
|
||||
self.proxyauth, self.proxy = urllib.splituser(self.proxy)
|
||||
if self.ignore_proxy_host():
|
||||
|
|
|
|||
Loading…
Reference in a new issue