This commit is contained in:
Suleyman Arif Uzun 2026-10-14 08:47:27 +03:00 • committed by GitHub
commit 063dd9e761
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View file

@ -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),

View file

@ -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"]