summaryrefslogtreecommitdiff
path: root/src/handler/staticfile.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/handler/staticfile.rs')
-rw-r--r--src/handler/staticfile.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/handler/staticfile.rs b/src/handler/staticfile.rs
index 969c4d7..f208528 100644
--- a/src/handler/staticfile.rs
+++ b/src/handler/staticfile.rs
@@ -39,7 +39,10 @@ impl Handle for StaticFile {
("content-length", format!("{}", metadata.len())),
("content-type", self.mime),
])
- .body(Body::File(file)))
+ .body(match request.method() {
+ Method::Get => Body::File(file),
+ Method::Head => Body::Empty,
+ }))
} else {
Ok(Response::builder()
.status(Status::NotFound)