Blame SOURCES/m2crypto-0.21.1-https-proxy.patch

cf4299
diff -urN M2Crypto/M2Crypto/httpslib.py M2Crypto-0.21.1/M2Crypto/httpslib.py
cf4299
--- M2Crypto/M2Crypto/httpslib.py	2012-03-15 03:27:22.181524406 +0100
cf4299
+++ M2Crypto-0.21.1/M2Crypto/httpslib.py	2012-03-15 03:27:40.467485033 +0100
cf4299
@@ -182,14 +182,14 @@
cf4299
         else:
cf4299
             HTTPSConnection.putheader(self, header, value)
cf4299
 
cf4299
-    def endheaders(self):
cf4299
+    def endheaders(self, *args, **kwargs):
cf4299
         # We've recieved all of hte headers. Use the supplied username
cf4299
         # and password for authorization, possibly overriding the authstring
cf4299
         # supplied in the headers.
cf4299
         if not self._proxy_auth:
cf4299
             self._proxy_auth = self._encode_auth()
cf4299
 
cf4299
-        HTTPSConnection.endheaders(self)
cf4299
+        HTTPSConnection.endheaders(self, *args, **kwargs)
cf4299
 
cf4299
     def connect(self):
cf4299
         HTTPConnection.connect(self)
cf4299
diff -urN M2Crypto/M2Crypto/m2urllib2.py M2Crypto-0.21.1/M2Crypto/m2urllib2.py
cf4299
--- M2Crypto/M2Crypto/m2urllib2.py	2011-01-15 20:10:05.000000000 +0100
cf4299
+++ M2Crypto-0.21.1/M2Crypto/m2urllib2.py	2012-03-15 03:27:40.467485033 +0100
cf4299
@@ -64,8 +64,10 @@
cf4299
         target_host = urlparse.urlparse(full_url)[1]
cf4299
 
cf4299
         if (target_host != host):
cf4299
+            request_uri = urlparse.urldefrag(full_url)[0]
cf4299
             h = httpslib.ProxyHTTPSConnection(host = host, ssl_context = self.ctx)
cf4299
         else:
cf4299
+            request_uri = req.get_selector()
cf4299
             h = httpslib.HTTPSConnection(host = host, ssl_context = self.ctx)
cf4299
         # End our change
cf4299
         h.set_debuglevel(self._debuglevel)
cf4299
@@ -80,7 +82,7 @@
cf4299
         # request.
cf4299
         headers["Connection"] = "close"
cf4299
         try:
cf4299
-            h.request(req.get_method(), req.get_selector(), req.data, headers)
cf4299
+            h.request(req.get_method(), request_uri, req.data, headers)
cf4299
             r = h.getresponse()
cf4299
         except socket.error, err: # XXX what error?
cf4299
             raise URLError(err)