User-Agent can be omited

This commit is contained in:
Igor Chubin 2018-10-03 19:43:53 +02:00
parent ef3cb4dd7c
commit 8e1479f6ba

View file

@ -322,7 +322,7 @@ def send_malformed():
@app.route("/<string:location>")
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