Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Mareš
Postal Owl
Commits
07e8413f
Commit
07e8413f
authored
May 28, 2021
by
Martin Mareš
Browse files
Fix Content-type of downloaded results
parent
b5053f4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
owl.py
View file @
07e8413f
...
...
@@ -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
.
mime
type
=
'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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment