Skip to content
Snippets Groups Projects
Commit 8534ef78 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Fixed KeyError when user provides no user-agent

parent b83a0501
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,8 @@ def index(request):
try:
# Check if user is on stock Android browser, which performs poorly with OpenLayers
user_is_stock_android = False
user_agent = request.META['HTTP_USER_AGENT']
user_agent = request.META.get('HTTP_USER_AGENT',"")
if user_agent.find("Android") >= 0 and user_agent.find("Windows") < 0:
chrome_index = user_agent.find("Chrome")
if chrome_index < 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment