From 2236567b5853e0e7d3f92b4635263b1103ac7571 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Thu, 19 Nov 2020 21:28:50 -0800 Subject: [PATCH] Fix style.css Content-Type and add robots.txt --- src/main.rs | 2 +- static/robots.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 static/robots.txt diff --git a/src/main.rs b/src/main.rs index 165be97..1ffa75b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ mod user; #[get("/style.css")] async fn style() -> HttpResponse { let file = fs::read_to_string("static/style.css").expect("ERROR: Could not read style.css"); - HttpResponse::Ok().body(file) + HttpResponse::Ok().content_type("text/css").body(file) } #[get("/favicon.ico")] diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 0000000..5534995 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,2 @@ +User-Agent: * +Disallow: / \ No newline at end of file