Skip to content

fix: remove chunked database download header#2777

Open
suzunn wants to merge 1 commit into
simonw:mainfrom
suzunn:fix-download-progress-header
Open

fix: remove chunked database download header#2777
suzunn wants to merge 1 commit into
simonw:mainfrom
suzunn:fix-download-progress-header

Conversation

@suzunn

@suzunn suzunn commented Jun 14, 2026

Copy link
Copy Markdown

Problem

Database downloads include both a Content-Length header and an explicit Transfer-Encoding: chunked header. Browsers do not show download progress for that response shape, even though the file size is already known.

Closes #2663.

Solution

I removed the manual Transfer-Encoding: chunked header from immutable database downloads and updated the existing download test to assert that the response keeps Content-Length without setting transfer-encoding.

Testing

  • uv run ruff check datasette\views\database.py tests\test_html.py
  • uv run black --check datasette\views\database.py tests\test_html.py
  • git diff --check

I also ran uv run pytest tests\test_html.py -k database_download_for_immutable -q. The response assertions completed, but the test fails during Windows temporary directory cleanup with PermissionError: [WinError 32] The process cannot access the file because it is being used by another process; that looks like the existing Windows file-handle cleanup issue tracked separately from this header change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Database download doesn't show progress bar in browsers

1 participant