Add HTTP Range header support for partial static file serving#62
Merged
Conversation
- Add Range header parsing for static files - Support three range types: start-end, start-, and -suffix - Return 206 Partial Content with Content-Range header - Return 416 Range Not Satisfiable for invalid ranges - Add Accept-Ranges: bytes header to all static responses - Only process ranges for uncompressed files (COMPRESS_METHOD_NONE) - HEAD requests bypass Range logic as expected - Fully backward compatible with non-Range requests Co-authored-by: L3P3 <4629449+L3P3@users.noreply.github.com>
- Add comment clarifying only single ranges are supported (not multipart) - Remove redundant range_start < 0 validation check - Add error handling for file streams to prevent crashes - Multi-range requests now gracefully fall back to full file (200 OK) Co-authored-by: L3P3 <4629449+L3P3@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for serving partial static files
Add HTTP Range header support for partial static file serving
Jan 1, 2026
Owner
|
@copilot I dont like the code duplication after the |
Use conditional object for createReadStream options instead of
separate if/else branches. Pass {start, end} when is_range_request
is true, otherwise pass empty object.
Co-authored-by: L3P3 <4629449+L3P3@users.noreply.github.com>
Contributor
Author
Done! Merged the duplicate code paths using a conditional object |
LFF5644
reviewed
Jan 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation Plan for Partial Static Files (HTTP Range Support)
Implementation Complete and Reviewed!
Features Added:
bytes=0-999- specific byte rangebytes=1000-- from byte to end of filebytes=-500- last N bytes (suffix range)Testing Results:
All test scenarios passed including:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.