Skip to content

fix(api): reject a download_format that differs from response_format - #570

Merged
remsky merged 2 commits into
remsky:masterfrom
davidcoulson:fix/download-format-mismatch
Nov 3, 2026
Merged

remsky merged 2 commits into
remsky:masterfrom
davidcoulson:fix/download-format-mismatch

Conversation

@davidcoulson

Copy link
Copy Markdown
Contributor

The download link file is written from the bytes encoded for
response_format; download_format only changed its extension and so its
served content type. mp3 with a wav download gave mp3 data named .wav,
which strict players and importers refuse.

Nothing re-encodes, so require the two to match (or download_format to
be unset) on the speech and dialogue requests. The web player already
sends the same value for both.

Testing

  • pytest: full suite passes.
  • test_download_format_* in test_request_bounds.py cover the speech and dialogue requests; the rejection test fails on master.
  • The web player sends the same value for both fields (AudioService.buildRequestBody), so it is unaffected.
  • On an RTX 3070 (Unraid, nvidia runtime), image built from docker/gpu/Dockerfile.optimized with this and the sibling PRs merged: mp3 with a wav download returns 422, and mp3 with an mp3 download still streams with its X-Download-Path.

Follows #562-#568 from the same review. Based on master on its own; the only overlap with those PRs is the CHANGELOG [Unreleased] section.

davidcoulson and others added 2 commits October 28, 2026 16:28
The download link file is written from the bytes encoded for
response_format; download_format only changed its extension and so its
served content type. mp3 with a wav download gave mp3 data named .wav,
which strict players and importers refuse.

Nothing re-encodes, so require the two to match (or download_format to
be unset) on the speech and dialogue requests. The web player already
sends the same value for both.
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.

2 participants