Fix downloaded filename
This commit is contained in:
parent
a884ac88d8
commit
600457fe19
|
@ -101,6 +101,7 @@ def setup_cors(app):
|
||||||
app,
|
app,
|
||||||
origins=origins,
|
origins=origins,
|
||||||
supports_credentials=True,
|
supports_credentials=True,
|
||||||
|
expose_headers={"Content-Disposition"},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,11 @@ async def download_original_file(req, slug: str):
|
||||||
if not track.is_visible_to_private(req.ctx.user):
|
if not track.is_visible_to_private(req.ctx.user):
|
||||||
raise Forbidden()
|
raise Forbidden()
|
||||||
|
|
||||||
return await file_stream(track.get_original_file_path(req.app.config))
|
return await file_stream(
|
||||||
|
track.get_original_file_path(req.app.config),
|
||||||
|
mime_type="text/csv",
|
||||||
|
filename=f"{slug}.csv",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@api.put("/tracks/<slug:str>")
|
@api.put("/tracks/<slug:str>")
|
||||||
|
|
Loading…
Reference in a new issue