mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
CSV export now respects --cors, fixes #326
This commit is contained in:
parent
e7566cc59d
commit
64c2fea8df
3 changed files with 40 additions and 14 deletions
|
|
@ -228,6 +228,8 @@ class BaseView(RenderMixin):
|
|||
|
||||
content_type = "text/plain; charset=utf-8"
|
||||
headers = {}
|
||||
if self.ds.cors:
|
||||
headers["Access-Control-Allow-Origin"] = "*"
|
||||
if request.args.get("_dl", None):
|
||||
content_type = "text/csv; charset=utf-8"
|
||||
disposition = 'attachment; filename="{}.csv"'.format(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue