1
0
mirror of https://github.com/searx/searx synced 2024-12-12 00:45:18 +01:00

[fix] csv results filename encoding

This commit is contained in:
Adam Tauber 2016-03-16 10:43:28 +01:00
parent e893d94185
commit 0f518e489e

View File

@ -433,7 +433,7 @@ def index():
csv.writerow([row.get(key, '') for key in keys]) csv.writerow([row.get(key, '') for key in keys])
csv.stream.seek(0) csv.stream.seek(0)
response = Response(csv.stream.read(), mimetype='application/csv') response = Response(csv.stream.read(), mimetype='application/csv')
cont_disp = 'attachment;Filename=searx_-_{0}.csv'.format(search.query) cont_disp = 'attachment;Filename=searx_-_{0}.csv'.format(search.query.encode('utf-8'))
response.headers.add('Content-Disposition', cont_disp) response.headers.add('Content-Disposition', cont_disp)
return response return response
elif search.request_data.get('format') == 'rss': elif search.request_data.get('format') == 'rss':