github
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/datasette/pull/737#issuecomment-619591533 | https://api.github.com/repos/simonw/datasette/issues/737 | 619591533 | MDEyOklzc3VlQ29tbWVudDYxOTU5MTUzMw== | 9599 | 2020-04-26T17:33:48Z | 2020-04-26T17:33:48Z | OWNER | > > Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow. > > I think I could do that with a custom template function - if that function is called during the render then we follow those instructions instead of returning the rendered HTML. https://github.com/simonw/datasette/issues/648#issuecomment-619591380 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
607067303 | |
https://github.com/simonw/datasette/pull/737#issuecomment-619593811 | https://api.github.com/repos/simonw/datasette/issues/737 | 619593811 | MDEyOklzc3VlQ29tbWVudDYxOTU5MzgxMQ== | 9599 | 2020-04-26T17:48:31Z | 2020-04-26T17:48:31Z | OWNER | Design challenge: the function that can be called in the custom template to return a custom status code and/or headers. Proposed design: ``` {{ custom_headers({"x-foo": "bar"}) }} {{ custom_status_code(404) }} ``` Or should I combine them into one function? ``` {{ custom_headers({"x-foo": "bar"}, status=404) }} ``` A common use-case here would be a redirect. How should that look? ``` {{ custom_redirect("/foo") }} - defaults to 301 {{ custom_redirect("/foo", status=302) }} ``` Maybe avoid dictionary syntax entirely: ``` {{ custom_header("x-foo", "bar") }} ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
607067303 | |
https://github.com/simonw/datasette/pull/737#issuecomment-619593899 | https://api.github.com/repos/simonw/datasette/issues/737 | 619593899 | MDEyOklzc3VlQ29tbWVudDYxOTU5Mzg5OQ== | 9599 | 2020-04-26T17:49:06Z | 2020-04-26T17:49:06Z | OWNER | I'm going with `custom_header(name, value)`, `custom_status(numeric_code)`, `custom_redirect("URL")`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
607067303 | |
https://github.com/simonw/datasette/pull/737#issuecomment-619599904 | https://api.github.com/repos/simonw/datasette/issues/737 | 619599904 | MDEyOklzc3VlQ29tbWVudDYxOTU5OTkwNA== | 9599 | 2020-04-26T18:21:06Z | 2020-04-26T18:21:06Z | OWNER | Just needs documentation now. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
607067303 |