Merge branch 'http-fix-contenttype' into 'master'

[Connection] Content-Type only in PUT and POST

See merge request famedly/famedlysdk!100
This commit is contained in:
Christian Pauly 2019-10-16 07:47:28 +00:00
commit b219cc8b5e

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