diff --git a/src/main.rs b/src/main.rs index 07a351e..b5520c5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ // Import Crates -use actix_web::{get, middleware, web, App, HttpResponse, HttpServer}; // dev::Service +use actix_web::{middleware, web, App, HttpResponse, HttpServer}; // dev::Service // Reference local files mod post; @@ -21,9 +21,10 @@ async fn robots() -> HttpResponse { .body(include_str!("../static/robots.txt")) } -#[get("/favicon.ico")] async fn favicon() -> HttpResponse { - HttpResponse::Ok().body("") + HttpResponse::Ok() + .header("Cache-Control", "public, max-age=1209600, s-maxage=86400") + .body(include_bytes!("../static/favicon.ico").as_ref()) } #[actix_web::main] @@ -64,7 +65,7 @@ async fn main() -> std::io::Result<()> { .default_service(web::get().to(|| utils::error("Nothing here".to_string()))) // GENERAL SERVICES .route("/style.css/", web::get().to(style)) - .route("/favicon.ico/", web::get().to(HttpResponse::Ok)) + .route("/favicon.ico/", web::get().to(favicon)) .route("/robots.txt/", web::get().to(robots)) // SETTINGS SERVICE .route("/settings/", web::get().to(settings::get)) diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..4ba6bfc Binary files /dev/null and b/static/favicon.ico differ diff --git a/templates/base.html b/templates/base.html index 4ac0cb1..b01e205 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,6 +8,7 @@ + {% endblock %} diff --git a/templates/post.html b/templates/post.html index 1a410df..4493f5a 100644 --- a/templates/post.html +++ b/templates/post.html @@ -27,7 +27,7 @@ {% endif %} {{ item.time }} -
{{ item.body }}
+