In order to support custom headers for various response types, this commit adds a wrapper type, ResponseWrapper, which can service all types of response in bin.
For paste objects, the preferred Last-Modified is used, so that caches can compare their exact timings with the HEAD response when revalidating.
For static objects, an ETag is used instead, based on the Cargo version and git hash of the codebase at compilation time; a build.rs is used for this.
[x] Cargo Format
Run cargo fmt on the project.
[x] Clippy lints
Run cargo clippy -- -Dwarnings on the project to check for suggestions
Run cargo clippy --fix to let clippy apply the suggestions itself, if any.
In order to support custom headers for various response types, this commit adds a wrapper type, ResponseWrapper, which can service all types of response in
bin
.For paste objects, the preferred
Last-Modified
is used, so that caches can compare their exact timings with the HEAD response when revalidating.For static objects, an
ETag
is used instead, based on the Cargo version and git hash of the codebase at compilation time; abuild.rs
is used for this.[x] Cargo Format
cargo fmt
on the project.[x] Clippy lints
cargo clippy -- -Dwarnings
on the project to check for suggestionscargo clippy --fix
to let clippy apply the suggestions itself, if any.