Skip to content

Commit

Permalink
test: fix tests based on mime-guess inference
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jun 30, 2024
1 parent 0b193c7 commit 763c584
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions actix-files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,11 @@ mod tests {
let resp = file.respond_to(&req);
assert_eq!(
resp.headers().get(header::CONTENT_TYPE).unwrap(),
"application/javascript; charset=utf-8"
"text/javascript",
);
assert_eq!(
resp.headers().get(header::CONTENT_DISPOSITION).unwrap(),
"inline; filename=\"test.js\""
"inline; filename=\"test.js\"",
);
}

Expand Down
7 changes: 2 additions & 5 deletions actix-http/src/responses/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,9 @@ mod tests {
assert_eq!(resp.headers().get(CONTENT_TYPE).unwrap(), "text/plain");

let resp = Response::build(StatusCode::OK)
.content_type(mime::APPLICATION_JAVASCRIPT_UTF_8)
.content_type(mime::TEXT_JAVASCRIPT)
.body(Bytes::new());
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
"application/javascript; charset=utf-8"
);
assert_eq!(resp.headers().get(CONTENT_TYPE).unwrap(), "text/javascript");
}

#[test]
Expand Down

0 comments on commit 763c584

Please sign in to comment.