mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Link rel=alternate header for tables and rows
Also added Access-Control-Expose-Headers: Link to --cors mode. Closes #1533 Refs https://github.com/simonw/datasette-notebook/issues/2 LL# metadata.json.1
This commit is contained in:
parent
2aa686c655
commit
3ef47a0896
9 changed files with 86 additions and 6 deletions
|
|
@ -137,10 +137,18 @@ class BaseView:
|
|||
],
|
||||
},
|
||||
}
|
||||
# Hacky cheat to add extra headers
|
||||
headers = {}
|
||||
if "_extra_headers" in context:
|
||||
headers.update(context["_extra_headers"])
|
||||
return Response.html(
|
||||
await self.ds.render_template(
|
||||
template, template_context, request=request, view_name=self.name
|
||||
)
|
||||
template,
|
||||
template_context,
|
||||
request=request,
|
||||
view_name=self.name,
|
||||
),
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue