From 2aa3ea758b939f251fdfc997a94f9bf8a30f2f3f Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Thu, 18 Apr 2019 19:11:04 +0200 Subject: [PATCH] Set content-type for livereload script Closes #667 --- src/cmd/serve.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/serve.rs b/src/cmd/serve.rs index 50894c36..b1724f82 100644 --- a/src/cmd/serve.rs +++ b/src/cmd/serve.rs @@ -86,8 +86,8 @@ impl Middleware for NotFoundHandler { } } -fn livereload_handler(_: &HttpRequest) -> &'static str { - LIVE_RELOAD +fn livereload_handler(_: &HttpRequest) -> HttpResponse { + HttpResponse::Ok().content_type("text/javascript").body(LIVE_RELOAD) } fn rebuild_done_handling(broadcaster: &Option, res: Result<()>, reload_path: &str) {