From bbb006fcf0c5afdfe3a061187ba72f6ae61fb092 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Wed, 17 Apr 2019 16:16:50 +0200 Subject: [PATCH] Set content-type header for index page --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index cc5a8a4..2837845 100644 --- a/src/main.rs +++ b/src/main.rs @@ -176,7 +176,9 @@ fn index() -> HttpResponse { let (tx, rx_body) = mpsc::unbounded(); let _ = tx.unbounded_send(Bytes::from(INDEX.as_bytes())); - HttpResponse::Ok().streaming(rx_body.map_err(|_| error::ErrorBadRequest("bad request"))) + HttpResponse::Ok() + .content_type("text/html") + .streaming(rx_body.map_err(|_| error::ErrorBadRequest("bad request"))) } fn main() -> std::io::Result<()> {