Rev 4784: (vila) More complete fix https trough proxies (bug #186920) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Nov 4 09:45:11 GMT 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4784 [merge]
revision-id: pqm at pqm.ubuntu.com-20091104094457-9ye9x123oc3su8ea
parent: pqm at pqm.ubuntu.com-20091103213122-868c6l4jp94gpi8h
parent: v.ladeuil+lp at free.fr-20091103175158-n2k5iv394kntvk9h
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-11-04 09:44:57 +0000
message:
(vila) More complete fix https trough proxies (bug #186920)
modified:
bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
=== 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