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.
This commit is contained in:
Damir Jelić 2021-03-01 16:37:56 +01:00
parent ffaddb22b8
commit 4c3cd29224

View file

@ -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);
}
}