Module: check_mk
Branch: master
Commit: 2ec79e278de1ffe50112a299a5490d0e03eb5d64
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ec79e278de1ff…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 7 15:23:04 2012 +0200
FIX: Dont crash on requests without User-Agent HTTP header
---
web/htdocs/index.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index c5e5377..05912ec 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -237,7 +237,7 @@ def handler(req, profiling = True):
if html.has_var("mobile"):
html.mobile = not not html.var("mobile")
else:
- user_agent = html.req.headers_in['User-Agent']
+ user_agent = html.req.headers_in.get('User-Agent', '')
html.mobile = mobile.is_mobile(user_agent)
# Redirect to mobile GUI if we are a mobile device and