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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 26 17:23:36 CET 2008


Author: bh
Date: 2008-11-26 17:23:36 +0100 (Wed, 26 Nov 2008)
New Revision: 178

Modified:
   trunk/ChangeLog
   trunk/inteproxy/proxycore.py
Log:
* inteproxy/proxycore.py
(InteProxyHTTPRequestHandler.open_http_connection): Add some
comments


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-11-26 16:16:13 UTC (rev 177)
+++ trunk/ChangeLog	2008-11-26 16:23:36 UTC (rev 178)
@@ -1,6 +1,12 @@
 2008-11-26  Bernhard Herzog  <bh at intevation.de>
 
 	* inteproxy/proxycore.py
+	(InteProxyHTTPRequestHandler.open_http_connection): Add some
+	comments
+
+2008-11-26  Bernhard Herzog  <bh at intevation.de>
+
+	* inteproxy/proxycore.py
 	(InteProxyHTTPRequestHandler.open_http_connection): Handle case
 	where an upstream proxy returns a 407 response (Proxy
 	Authentication Required) by converting it to 502 (Bad Gateway).

Modified: trunk/inteproxy/proxycore.py
===================================================================
--- trunk/inteproxy/proxycore.py	2008-11-26 16:16:13 UTC (rev 177)
+++ trunk/inteproxy/proxycore.py	2008-11-26 16:23:36 UTC (rev 178)
@@ -185,6 +185,12 @@
                                                response.msg, response)
         response_message.debug_log_message(self.log_debug)
 
+        # If an upstream server responds with 407, it's a proxy
+        # requiring authentication.  We already sent all credentials we
+        # know, so we can't do anything about it here, but we can send
+        # an error to the inteproxy client.  We convert it to a 502
+        # error, so that the client does not mistakenly think inteproxy
+        # itself requires authentication
         if response_message.status == 407:
             self.log_debug("upstream sent %d: %r; converting to 502",
                            response_message.status, response_message.reason)



More information about the Inteproxy-commits mailing list