From 4c3cd292242209e7dd838919f36848dd39288bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 1 Mar 2021 16:37:56 +0100 Subject: [PATCH] matrix-sdk: Don't set two content-type headers for json contents Ruma will for some requests already set the content-type for us to application/json, but for some it still seems to miss the header, since the headers are kept in a map add the header only if it isn't already there. --- matrix_sdk/src/http_client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix_sdk/src/http_client.rs b/matrix_sdk/src/http_client.rs index cd7d6265..2e508d69 100644 --- a/matrix_sdk/src/http_client.rs +++ b/matrix_sdk/src/http_client.rs @@ -130,7 +130,7 @@ impl HttpClient { if let Some(content_type) = content_type { request .headers_mut() - .append(http::header::CONTENT_TYPE, content_type); + .insert(http::header::CONTENT_TYPE, content_type); } }