Skip to content

Commit 4fb2d5d

Browse files
committed
update tests to correct javascript after mime_guess update
1 parent 3193037 commit 4fb2d5d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/storage/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ fn detect_mime(file_path: impl AsRef<Path>) -> &'static str {
813813
Some("markdown") => "text/markdown",
814814
Some("css") => "text/css",
815815
Some("toml") => "text/toml",
816-
Some("js") => "application/javascript",
816+
Some("js") => "text/javascript",
817817
Some("json") => "application/json",
818818
_ => mime,
819819
}
@@ -852,7 +852,7 @@ mod test {
852852
check_mime(".gitignore", "text/plain");
853853
check_mime("hello.toml", "text/toml");
854854
check_mime("hello.css", "text/css");
855-
check_mime("hello.js", "application/javascript");
855+
check_mime("hello.js", "text/javascript");
856856
check_mime("hello.html", "text/html");
857857
check_mime("hello.hello.md", "text/markdown");
858858
check_mime("hello.markdown", "text/markdown");

src/web/statics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ mod tests {
158158
assert_cache_control(&resp, CachePolicy::ForeverInCdnAndBrowser, &env.config());
159159
assert_eq!(
160160
resp.headers().get("Content-Type"),
161-
Some(&"application/javascript".parse().unwrap()),
161+
Some(&"text/javascript".parse().unwrap()),
162162
);
163163
assert!(resp.content_length().unwrap() > 10);
164164
assert!(resp.text()?.contains(expected_content));

0 commit comments

Comments
 (0)