From d84fd9cdf58813911e0059ad3e4c82485d200b5d Mon Sep 17 00:00:00 2001 From: suzunn Date: Sun, 14 Jun 2026 09:09:07 +0300 Subject: [PATCH] fix: remove chunked database download header --- datasette/views/database.py | 1 - tests/test_html.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/datasette/views/database.py b/datasette/views/database.py index 6afd9734a7..a17145b518 100644 --- a/datasette/views/database.py +++ b/datasette/views/database.py @@ -444,7 +444,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), diff --git a/tests/test_html.py b/tests/test_html.py index 20ab22bc19..e46ae9e219 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -548,12 +548,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"]