mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
CORS headers for JSON responses
Access-Control-Allow-Origin: *
This commit is contained in:
parent
12f7e1dc56
commit
255e2611e5
1 changed files with 1 additions and 0 deletions
1
app.py
1
app.py
|
|
@ -89,6 +89,7 @@ class BaseView(HTTPMethodView):
|
|||
data = self.data(request, name, hash, **kwargs)
|
||||
if as_json:
|
||||
r = response.json(data)
|
||||
r.headers['Access-Control-Allow-Origin'] = '*'
|
||||
else:
|
||||
r = jinja.render(
|
||||
self.template,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue