SVN: r23568 - trunk/quixote

Neil Schemenauer <nascheme-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Wed, 25 Feb 2004 12:18:49 -0500
Newsgroups gmane.comp.web.quixote.cvs
Message-ID <[email protected]>
Author: nascheme
Date: 2004-02-25 12:18:49 -0500 (Wed, 25 Feb 2004)
New Revision: 23568

Modified:
   trunk/quixote/http_request.py
Log:
Make get_server() return HTTP_HOST if it is available rather than using
SERVER_NAME and SERVER_PORT.


Modified: trunk/quixote/http_request.py
===================================================================
--- trunk/quixote/http_request.py	2004-02-25 17:13:07 UTC (rev 23567)
+++ trunk/quixote/http_request.py	2004-02-25 17:18:49 UTC (rev 23568)
@@ -210,9 +210,11 @@
         Return the server name with an optional port number, eg.
         "www.example.com" or "foo.bar.com:8000".
         """
+        http_host = self.environ.get("HTTP_HOST")
+        if http_host:
+            return http_host
         server_name = self.environ["SERVER_NAME"].strip()
         server_port = self.environ.get("SERVER_PORT")
-
         if (not server_port or
             (self.scheme == "http" and server_port == "80") or
             (self.scheme == "https" and server_port == "443")):