Commit 07e8413f authored by Martin Mareš's avatar Martin Mareš
Browse files

Fix Content-type of downloaded results

parent b5053f4f
......@@ -968,7 +968,7 @@ def export_points(format):
enc = JSONEncoder(ensure_ascii=False, sort_keys=True, indent=4)
resp = make_response(enc.encode(out))
resp.headers.add('Content-type', 'application/json')
resp.mimetype = 'application/json'
return resp
elif format == "csv":
out = io.StringIO()
......@@ -982,7 +982,8 @@ def export_points(format):
sum(points[s.uid].values()),
] + [points[s.uid].get(t.ident, "") for t in topics])
resp = make_response(out.getvalue())
resp.headers.add('Content-type', 'text/csv; charset=utf-8')
resp.mimetype = 'text/csv'
resp.mimetype_params['charset'] = 'utf-8'
return resp
else:
raise NotImplementedError()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment