fix: incorrect json response content type

This commit is contained in:
gengteng
2023-08-01 22:11:44 +08:00
parent 9336fa2ad9
commit a48a2a640c
5 changed files with 27 additions and 35 deletions

9
tests/utils.rs Normal file
View File

@@ -0,0 +1,9 @@
/// Check if the response is a json response
#[cfg(feature = "into_json")]
pub async fn check_json(response: reqwest::Response) {
assert_eq!(
response.headers()[axum::http::header::CONTENT_TYPE],
axum::http::HeaderValue::from_static(mime::APPLICATION_JSON.as_ref())
);
assert!(response.json::<serde_json::Value>().await.is_ok());
}