mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Add ETag header for static responses (#2306)
* add etag to static responses * fix RuntimeError related to static headers * Remove unnecessary import --------- Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
parent
261fc8d875
commit
67e66f36c1
4 changed files with 55 additions and 2 deletions
|
|
@ -78,6 +78,10 @@ async def test_static(ds_client):
|
|||
response = await ds_client.get("/-/static/app.css")
|
||||
assert response.status_code == 200
|
||||
assert "text/css" == response.headers["content-type"]
|
||||
assert "etag" in response.headers
|
||||
etag = response.headers.get("etag")
|
||||
response = await ds_client.get("/-/static/app.css", headers={"if-none-match": etag})
|
||||
assert response.status_code == 304
|
||||
|
||||
|
||||
def test_static_mounts():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue