[Connection] Content-Type only in PUT and POST

This commit is contained in:
Christian Pauly 2019-10-16 07:47:28 +00:00
parent dee3aad69d
commit 9d4b3bbc18

View file

@ -221,9 +221,9 @@ class Connection {
final url = "${client.homeserver}/_matrix${action}";
Map<String, String> headers = {
"Content-Type": contentType,
};
Map<String, String> headers = {};
if (type == HTTPType.PUT || type == HTTPType.POST)
headers["Content-Type"] = contentType;
if (client.isLogged())
headers["Authorization"] = "Bearer ${client.accessToken}";