add some headers to the favicon

* content-type to image/png
* cache control for 24h
This commit is contained in:
Damjan Georgievski 2018-07-22 17:45:19 +02:00
parent 1aeb2c1bf6
commit d2f9578b68

View file

@ -97,5 +97,8 @@ fn handle_tar(req: &HttpRequest<PathBuf>) -> impl Responder {
}
fn favicon_ico(_req: &HttpRequest<PathBuf>) -> impl Responder {
bytes::Bytes::from_static(include_bytes!("favicon.png"))
HttpResponse::Ok()
.content_type("image/png")
.header("Cache-Control", "only-if-cached, max-age=86400")
.body(bytes::Bytes::from_static(include_bytes!("favicon.png")))
}