Crates.io | http-file-headers |
lib.rs | http-file-headers |
version | 0.1.8 |
source | src |
created_at | 2017-08-25 14:48:01.270461 |
updated_at | 2018-06-27 15:40:28.419159 |
description | A framework-agnostic helper library for serving static files. It makes very easy to write full-featured static file server (incl. conditional headers, encodings, range requests, etc) |
homepage | http://github.com/swindon-rs/http-file-headers |
repository | |
max_upload_size | |
id | 29099 |
size | 77,684 |
Github | Documentaion | Examples | Crate
A framework-agnostic library that parses file-related headers from HTTP request and helps serving files including support of:
ETag
, If-None-Match
Last-Modified
, If-Modified-Since
Accept-Ranges
, Range
, Content-Range
Content-Type
using mime_guessAccept-Encoding
for serving compressed (gzip and brotli) filesindex.html
or similar directory indexesThe library is not tied to any framework, HTTP or even async library. So it's usage is quite verbose (see example). Still it does most of the complex work internally and is easily adapted to different needs.
Here are just few things that example in < 200 LoCs shows:
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.