evgenyigumnov / cblt

Safe and fast minimalistic web server, written in Rust, that serves files from a directory and proxies requests to another server.
MIT License
40 stars 7 forks source link

Implement Range Requests for Static File Downloads #29

Closed evgenyigumnov closed 6 days ago

evgenyigumnov commented 6 days ago

Add support for HTTP range requests to the web server, allowing clients to download parts of static files. This feature will enable better handling of large file downloads, improve streaming efficiency, and support resumable downloads. The implementation should include:

  1. Parsing the Range header from incoming HTTP requests.
  2. Serving the requested byte ranges of static files.
  3. Handling edge cases, such as invalid ranges and multipart range requests.
  4. Ensuring proper HTTP status codes and headers are used, including 206 Partial Content and Content-Range.

This feature will enhance the server's performance and usability, especially for media streaming and large file transfers.

evgenyigumnov commented 6 days ago

https://github.com/evgenyigumnov/cblt/commit/56abe9cc4295159452df779703feb17bd1c611b5