[Inteproxy-commits] r147 - in trunk: . inteproxy

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jun 16 12:38:35 CEST 2008


Author: bh
Date: 2008-06-16 12:38:34 +0200 (Mon, 16 Jun 2008)
New Revision: 147

Modified:
   trunk/ChangeLog
   trunk/inteproxy/proxycore.py
Log:
* inteproxy/proxycore.py: Pass the response's version through to
the client instread of assuming it's the same as the request
version.  Update the comment.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-06-13 12:03:12 UTC (rev 146)
+++ trunk/ChangeLog	2008-06-16 10:38:34 UTC (rev 147)
@@ -1,3 +1,9 @@
+2008-06-16  Bernhard Herzog  <bh at intevation.de>
+
+	* inteproxy/proxycore.py: Pass the response's version through to
+	the client instread of assuming it's the same as the request
+	version.  Update the comment.
+
 2008-06-13  Bernhard Herzog  <bh at intevation.de>
 
 	Remove support for the SHUTDOWN HTTP Method.  It was inherited

Modified: trunk/inteproxy/proxycore.py
===================================================================
--- trunk/inteproxy/proxycore.py	2008-06-13 12:03:12 UTC (rev 146)
+++ trunk/inteproxy/proxycore.py	2008-06-16 10:38:34 UTC (rev 147)
@@ -175,22 +175,12 @@
 
 
     def handle_response(self, response):
-        # Ideally, the HTTP version in our reply to the client should be
-        # what the remote server used in its reply.  Unfortunately,
-        # there doesn't seem to be a way to get that information from
-        # urllib2.  So we pretend that the reply uses the same version
-        # as the request we got from the client.
-        #
-        # If we do not set the version of the reply,
-        # BaseHTTPRequestHandler will use HTTP/1.0 which can lead to
-        # problems if the real version is HTTP/1.1, because the server
-        # might send the data using the chunked transfer encoding which
-        # not alled in HTTP/1.0.  Some clients, including Firefox 1.5,
-        # produce errors in that case.
-        #
         # The HTTP version in the reply generated by send_response is
-        # taken from self.protocol_version.
-        self.protocol_version = self.request_version
+        # taken from self.protocol_version.  We simply set it to
+        # whatever version was returned by the remote host.  That's what
+        # the client would have received anyway, if it hadn't connected
+        # via the InteProxy.
+        self.protocol_version = response.version
         self.send_response(response.status, response.reason)
 
         for header, value in response.headers.items():



More information about the Inteproxy-commits mailing list