]> granicus.if.org Git - python/commitdiff
Patches to make the proxy code work again. (Why does that always break
authorGuido van Rossum <guido@python.org>
Tue, 5 May 1998 13:58:13 +0000 (13:58 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 5 May 1998 13:58:13 +0000 (13:58 +0000)
as soon as I change things even just a little bit? :-)  Even works
when accessing a password-protected page through the proxy.  Prompted
by complaints from, and correct operation verified by, Nigel O'Brian.

Lib/urllib.py

index 1f110c0dd4849998cf49de38918c97e2b0efe7f6..cabfeeeb6d7a4cb78474ceda3a0aff25fb5ecdf0 100644 (file)
@@ -223,6 +223,7 @@ class URLopener:
                else:
                        host, selector = url
                        urltype, rest = splittype(selector)
+                       url = rest
                        user_passwd = None
                        if string.lower(urltype) != 'http':
                                realhost = None
@@ -459,8 +460,8 @@ class FancyURLopener(URLopener):
                user, passwd = self.get_user_passwd(host, realm, i)
                if not (user or passwd): return None
                host = user + ':' + passwd + '@' + host
-               newurl = '//' + host + selector
-               return self.open_http(newurl)
+               newurl = 'http://' + host + selector
+               return self.open(newurl)
 
        def get_user_passwd(self, host, realm, clear_cache = 0):
                key = realm + '@' + string.lower(host)