[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
1 changed files with 3 additions and 3 deletions

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}";