1
0
mirror of https://github.com/searx/searx synced 2024-11-25 19:30:01 +01:00

[enh] valid json content type

This commit is contained in:
asciimoo 2013-10-23 21:45:00 +02:00
parent 5e358ea9a9
commit 52516dab97

View File

@ -82,7 +82,7 @@ def index():
results = search(query, request, selected_categories)
if request_data.get('format') == 'json':
# TODO HTTP headers
return json.dumps({'query': query, 'results': results})
return Response(json.dumps({'query': query, 'results': results}), mimetype='application/json')
template = render('results.html'
,results=results
,q=query.decode('utf-8')