From 078d0d89eeee4bbe8c6befe531dd8f9d96812cc1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 2 Jul 2009 14:31:19 +0200 Subject: [PATCH] Fixed page impression for hosts that don't provide HTTP_ACCEPT_LANGUAGE. e.g. the google bot. --- www/redirect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/redirect.py b/www/redirect.py index 1a673be1..c8a1fc39 100644 --- a/www/redirect.py +++ b/www/redirect.py @@ -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" -- 2.47.3