changeset 17:3a1fb496b47d

fix host matching if HTTP_HOST is not given
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 30 Dec 2012 20:11:48 -0800
parents b1a5abacf1f3
children d30118837c1a
files wsgintegrate/match.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/wsgintegrate/match.py	Tue Aug 28 21:53:55 2012 -0700
+++ b/wsgintegrate/match.py	Sun Dec 30 20:11:48 2012 -0800
@@ -91,7 +91,9 @@
     self.port = port
 
   def condition(self, environ):
-    host = environ['HTTP_HOST']
+    host = environ.get('HTTP_HOST')
+    if host is None:
+        return False
     port = None
     if ':' in host:
         host, port = host.rsplit(':', 1)