Skip to content

Commit

Permalink
update tests to correct javascript after mime_guess update
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Jul 10, 2024
1 parent dfded96 commit b417df7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ fn detect_mime(file_path: impl AsRef<Path>) -> &'static str {
Some("markdown") => "text/markdown",
Some("css") => "text/css",
Some("toml") => "text/toml",
Some("js") => "application/javascript",
Some("js") => "text/javascript",
Some("json") => "application/json",
_ => mime,
}
Expand Down Expand Up @@ -852,7 +852,7 @@ mod test {
check_mime(".gitignore", "text/plain");
check_mime("hello.toml", "text/toml");
check_mime("hello.css", "text/css");
check_mime("hello.js", "application/javascript");
check_mime("hello.js", "text/javascript");
check_mime("hello.html", "text/html");
check_mime("hello.hello.md", "text/markdown");
check_mime("hello.markdown", "text/markdown");
Expand Down
2 changes: 1 addition & 1 deletion src/web/statics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod tests {
assert_cache_control(&resp, CachePolicy::ForeverInCdnAndBrowser, &env.config());
assert_eq!(
resp.headers().get("Content-Type"),
Some(&"application/javascript".parse().unwrap()),
Some(&"text/javascript".parse().unwrap()),
);
assert!(resp.content_length().unwrap() > 10);
assert!(resp.text()?.contains(expected_content));
Expand Down

0 comments on commit b417df7

Please sign in to comment.