diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 58431a2..d3c88f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,7 @@ use serde::Deserialize; use sputnik::html_escape; use sputnik::mime; use sputnik::request::SputnikParts; +use sputnik::response::EmptyBuilder; use sputnik::response::SputnikBuilder; use std::convert::Infallible; use std::env; @@ -241,6 +242,12 @@ async fn service<C: Controller>( Error::Forbidden(msg) => (403, msg), Error::NotFound(msg) => (404, msg), Error::Internal(msg) => (500, msg), + Error::NotModified => { + return Builder::new() + .status(StatusCode::NOT_MODIFIED) + .empty() + .unwrap(); + } Error::MissingTrailingSlash(path) => { return Builder::new() .status(StatusCode::FOUND) |