From 763c58445af61531b7fe335679e773755cad73d8 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 30 Jun 2024 20:28:11 +0100 Subject: [PATCH] test: fix tests based on mime-guess inference relates to https://github.com/abonander/mime_guess/pull/86 --- actix-files/src/lib.rs | 4 ++-- actix-http/src/responses/builder.rs | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/actix-files/src/lib.rs b/actix-files/src/lib.rs index 167f996c0..0178c13de 100644 --- a/actix-files/src/lib.rs +++ b/actix-files/src/lib.rs @@ -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\"", ); } diff --git a/actix-http/src/responses/builder.rs b/actix-http/src/responses/builder.rs index 91c69ba54..bb7d0f712 100644 --- a/actix-http/src/responses/builder.rs +++ b/actix-http/src/responses/builder.rs @@ -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]