Skip to content
Snippets Groups Projects
Commit dcd8ff06 authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Attempting to get the User-Agent within a try-except block so as to make the...

Attempting to get the User-Agent within a try-except block so as to make the service usable even without the User-Agent header
parent 0160caf1
No related branches found
No related tags found
No related merge requests found
Pipeline #3198 passed
......@@ -23,10 +23,12 @@ def index():
if not os.path.isfile('cache/%s' % filename):
refresh_cache()
user_agent = request.headers.get('User-Agent')
if 'windows' in user_agent.lower():
filename = 'catalog-windows1252.csv'
try:
user_agent = request.headers.get('User-Agent')
if 'windows' in user_agent.lower():
filename = 'catalog-windows1252.csv'
except:
pass
return send_file('cache/%s' % filename,
mimetype='text/csv',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment