mirror of
https://github.com/simonw/datasette.git
synced 2026-10-18 15:26:57 +02:00
Merge d84fd9cdf5 into c435a80030
This commit is contained in:
commit
063dd9e761
2 changed files with 1 additions and 2 deletions
|
|
@ -567,7 +567,6 @@ async def database_download(request, datasette):
|
|||
if_none_match = request.headers.get("if-none-match")
|
||||
if if_none_match and if_none_match == etag:
|
||||
return Response("", status=304)
|
||||
headers["Transfer-Encoding"] = "chunked"
|
||||
return AsgiFileDownload(
|
||||
filepath,
|
||||
filename=os.path.basename(filepath),
|
||||
|
|
|
|||
|
|
@ -661,12 +661,12 @@ def test_database_download_for_immutable():
|
|||
content_length = download_response.headers["content-length"]
|
||||
assert content_length.isdigit()
|
||||
assert int(content_length) > 100
|
||||
assert "transfer-encoding" not in download_response.headers
|
||||
assert "content-disposition" in download_response.headers
|
||||
assert (
|
||||
download_response.headers["content-disposition"]
|
||||
== 'attachment; filename="fixtures.db"'
|
||||
)
|
||||
assert download_response.headers["transfer-encoding"] == "chunked"
|
||||
# ETag header should be present and match db.hash
|
||||
assert "etag" in download_response.headers
|
||||
etag = download_response.headers["etag"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue