diff options
author | bbangert <none@none> | 2006-10-30 12:59:34 -0800 |
---|---|---|
committer | bbangert <none@none> | 2006-10-30 12:59:34 -0800 |
commit | dde994943413b0ff3e99dac7b8d91fd338ed23c7 (patch) | |
tree | 6b41a1a1946291c2219414ad5f0a9138adca9fdc | |
parent | ac0bc9a67d47d40bdb16968c1366562dd01e0017 (diff) | |
download | routes-dde994943413b0ff3e99dac7b8d91fd338ed23c7.tar.gz |
[svn] Fixed possible issue with host name fallback to SERVER_NAME, as specified in the WSGI PEP.
--HG--
branch : trunk
-rw-r--r-- | routes/util.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routes/util.py b/routes/util.py index 11258b6..472eb0f 100644 --- a/routes/util.py +++ b/routes/util.py @@ -45,7 +45,8 @@ def _screenargs(kargs): def _subdomain_check(config, kargs): if config.mapper.sub_domains: subdomain = kargs.pop('sub_domain', None) - hostmatch = config.environ['HTTP_HOST'].split(':') + fullhost = config.environ.get('HTTP_HOST') or config.environ.get('SERVER_NAME') + hostmatch = fullhost.split(':') host = hostmatch[0] port = '' if len(hostmatch) > 1: |