Rev 4783: More complete fix https trough proxies (bug #186920) in http://bazaar.launchpad.net/~vila/bzr/integration

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Nov 3 17:52:10 GMT 2009


At http://bazaar.launchpad.net/~vila/bzr/integration

------------------------------------------------------------
revno: 4783 [merge]
revision-id: v.ladeuil+lp at free.fr-20091103175158-n2k5iv394kntvk9h
parent: pqm at pqm.ubuntu.com-20091103035826-tr4qa6fznzmirgiq
parent: v.ladeuil+lp at free.fr-20091103134616-gzloapjtw6i1btxv
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: integration
timestamp: Tue 2009-11-03 18:51:58 +0100
message:
  More complete fix https trough proxies (bug #186920)
modified:
  bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
-------------- next part --------------
=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
--- a/bzrlib/transport/http/_urllib2_wrappers.py	2009-10-30 21:02:37 +0000
+++ b/bzrlib/transport/http/_urllib2_wrappers.py	2009-11-03 13:46:16 +0000
@@ -366,13 +366,16 @@
 
     def set_proxy(self, proxy, type):
         """Set the proxy and remember the proxied host."""
-        # We need to set the default port ourselves way before it gets set
-        # in the HTTP[S]Connection object at build time.
-        if self.type == 'https':
-            conn_class = HTTPSConnection
-        else:
-            conn_class = HTTPConnection
-        self.proxied_host = '%s:%s' % (self.get_host(), conn_class.default_port)
+        host, port = urllib.splitport(self.get_host())
+        if port is None:
+            # We need to set the default port ourselves way before it gets set
+            # in the HTTP[S]Connection object at build time.
+            if self.type == 'https':
+                conn_class = HTTPSConnection
+            else:
+                conn_class = HTTPConnection
+            port = conn_class.default_port
+        self.proxied_host = '%s:%s' % (host, port)
         urllib2.Request.set_proxy(self, proxy, type)
 
 



More information about the bazaar-commits mailing list