From 5854b31b76cc8a7f71595ffd362638b937bc96a4 Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Sat, 10 Mar 2018 16:04:37 -0800 Subject: [PATCH] serve .map files as Javascript This fixes #47 for now at least. --- src/web.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/web.rs b/src/web.rs index 308655a..ecd2cd8 100644 --- a/src/web.rs +++ b/src/web.rs @@ -424,8 +424,9 @@ impl Service { }; let (p, mime) = match e.file_name().to_str() { Some(n) if n == "index.html" => ("/".to_owned(), mime::TEXT_HTML), - Some(n) if n.ends_with(".js") => (format!("/{}", n), mime::TEXT_JAVASCRIPT), Some(n) if n.ends_with(".html") => (format!("/{}", n), mime::TEXT_HTML), + Some(n) if n.ends_with(".js") => (format!("/{}", n), mime::TEXT_JAVASCRIPT), + Some(n) if n.ends_with(".map") => (format!("/{}", n), mime::TEXT_JAVASCRIPT), Some(n) if n.ends_with(".png") => (format!("/{}", n), mime::IMAGE_PNG), Some(n) => { warn!("UI directory file {:?} has unknown extension; skipping", n);