From b48799a74c372e87795cfb33155a43bc1d015c73 Mon Sep 17 00:00:00 2001 From: max143672 Date: Mon, 19 Jun 2023 11:15:57 +0400 Subject: [PATCH 1/3] set default content-type --- engineioxide/src/futures.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/engineioxide/src/futures.rs b/engineioxide/src/futures.rs index 8cd9cb09..19bd5e61 100644 --- a/engineioxide/src/futures.rs +++ b/engineioxide/src/futures.rs @@ -24,6 +24,7 @@ where { Response::builder() .status(code) + .header("Content-Type", "text/plain") .body(ResponseBody::custom_response(data.into())) } From f73f77693a9dee0b0c2f930685181aaa013cbf71 Mon Sep 17 00:00:00 2001 From: max143672 Date: Mon, 19 Jun 2023 11:27:58 +0400 Subject: [PATCH 2/3] set charset --- engineioxide/src/futures.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engineioxide/src/futures.rs b/engineioxide/src/futures.rs index 19bd5e61..17e13492 100644 --- a/engineioxide/src/futures.rs +++ b/engineioxide/src/futures.rs @@ -24,7 +24,7 @@ where { Response::builder() .status(code) - .header("Content-Type", "text/plain") + .header("Content-Type", "text/plain; charset=UTF-8") .body(ResponseBody::custom_response(data.into())) } From ada077fb9e9ec2ffddf880122d9d4ad901e87101 Mon Sep 17 00:00:00 2001 From: max143672 Date: Mon, 19 Jun 2023 13:01:00 +0400 Subject: [PATCH 3/3] add content type header to connection error response --- engineioxide/src/errors.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/engineioxide/src/errors.rs b/engineioxide/src/errors.rs index bac50906..5e307019 100644 --- a/engineioxide/src/errors.rs +++ b/engineioxide/src/errors.rs @@ -58,6 +58,7 @@ impl From for Response> { let conn_err_resp = |message: &'static str| { Response::builder() .status(400) + .header("Content-Type", "application/json") .body(ResponseBody::custom_response(message.into())) .unwrap() };