From 8e1479f6ba7aced81144e76ef7bfc7f87c2e111a Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Wed, 3 Oct 2018 19:43:53 +0200 Subject: [PATCH] User-Agent can be omited --- bin/srv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/srv.py b/bin/srv.py index 4f30cca..a76e524 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -322,7 +322,7 @@ def send_malformed(): @app.route("/") def wttr(location = None): - user_agent = request.headers.get('User-Agent').lower() + user_agent = request.headers.get('User-Agent', '').lower() if any(agent in user_agent for agent in PLAIN_TEXT_AGENTS): html_output = False