Fixed broken CSS on 404 page, closes #777

This commit is contained in:
Simon Willison 2020-06-08 17:35:23 -07:00
commit 647c5ff0f3
2 changed files with 22 additions and 1 deletions

View file

@ -1015,7 +1015,16 @@ class DatasetteRouter(AsgiRouter):
templates = ["500.html"]
if status != 500:
templates = ["{}.html".format(status)] + templates
info.update({"ok": False, "error": message, "status": status, "title": title})
info.update(
{
"ok": False,
"error": message,
"status": status,
"title": title,
"base_url": self.ds.config("base_url"),
"app_css_hash": self.ds.app_css_hash(),
}
)
headers = {}
if self.ds.cors:
headers["Access-Control-Allow-Origin"] = "*"