download_attachment.php has no HTTP Range/partial-content support #99

Closed
opened 2026-09-01 00:13:38 -04:00 by jared · 1 comment
Owner

Severity: Low

api/download_attachment.php's streaming loop reads and emits the entire file unconditionally regardless of any Range request header, and no Accept-Ranges header is ever set.

Impact: Large video or PDF attachments can't be scrubbed/seeked in-browser, and an interrupted download can't be resumed — every retry re-transfers the whole file from the start.

Fix: Add Accept-Ranges: bytes and honor Range request headers with a 206 Partial Content response for large files.

**Severity:** Low `api/download_attachment.php`'s streaming loop reads and emits the entire file unconditionally regardless of any `Range` request header, and no `Accept-Ranges` header is ever set. **Impact:** Large video or PDF attachments can't be scrubbed/seeked in-browser, and an interrupted download can't be resumed — every retry re-transfers the whole file from the start. **Fix:** Add `Accept-Ranges: bytes` and honor `Range` request headers with a 206 Partial Content response for large files.
jared added the performancepriority/low labels 2026-09-08 10:15:50 -04:00
Author
Owner

Fixed and verified (real MariaDB/jsdom/curl-range as applicable). Merged to main in commit 23d94bf.

Fixed and verified (real MariaDB/jsdom/curl-range as applicable). Merged to main in commit 23d94bf.
jared closed this issue 2026-09-08 21:18:23 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#99