]> git.ipfire.org Git - ipfire.org.git/commitdiff
Fixed page impression for hosts that don't provide HTTP_ACCEPT_LANGUAGE.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Jul 2009 12:31:19 +0000 (14:31 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Jul 2009 12:31:19 +0000 (14:31 +0200)
e.g. the google bot.

www/redirect.py

index 1a673be15bb09bcf382d0951168881c1a99c442c..c8a1fc3974df083ef84db90575b9e6d5c26f9bb7 100644 (file)
@@ -6,7 +6,8 @@ import cgi
 from web.http import HTTPResponse
 
 for language in ("de", "en",):
-       if os.environ["HTTP_ACCEPT_LANGUAGE"].startswith(language):
+       if os.environ.has_key("HTTP_ACCEPT_LANGUAGE") and \
+                       os.environ["HTTP_ACCEPT_LANGUAGE"].startswith(language):
                break
 
 site = cgi.FieldStorage().getfirst("site") or "index"