forked from rstudio/httpuv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add partial support for the 'Range' header when serving static files.
This includes * Parsing and validation of the most common forms[0] of the `Range` header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of files and enabling resumable downloads, etc. * Support for returning partial files matching these slices on Unix platforms. * Support for returning the appropriate `Content-Range` header and HTTP 206 responses for these requests. * Tests for these features (some of which are skipped on Windows). It does not support Windows as of yet, and there is no support for multipart ranges[2] or the `If-Range` header[3]. Since `Range` header support is always optional (a server can just respond with the whole file and a HTTP 200 instead), we just fall back on existing behaviour in these cases instead of issuing some kind of error. Along these same lines, we don't yet advertise that we support the `Range` header by sending an `Accept-Ranges: bytes` header[4] on other GET/HEAD requests. Closes rstudio#259. [0]: https://tools.ietf.org/html/rfc7233#section-3.1 [2]: https://tools.ietf.org/html/rfc7233#appendix-A [3]: https://tools.ietf.org/html/rfc7233#section-3.2 [4]: https://tools.ietf.org/html/rfc7233#section-2.3
- Loading branch information
Showing
6 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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