serve .map files as Javascript

This fixes #47 for now at least.
This commit is contained in:
Scott Lamb 2018-03-10 16:04:37 -08:00
parent 84ce24b7f6
commit 5854b31b76

View File

@ -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);