From 9d4b3bbc18a42f04b7ade2ef90a6af7eb7ff66f7 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Wed, 16 Oct 2019 07:47:28 +0000 Subject: [PATCH] [Connection] Content-Type only in PUT and POST --- lib/src/Connection.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/Connection.dart b/lib/src/Connection.dart index 538786e8..1e2c7b1a 100644 --- a/lib/src/Connection.dart +++ b/lib/src/Connection.dart @@ -221,9 +221,9 @@ class Connection { final url = "${client.homeserver}/_matrix${action}"; - Map headers = { - "Content-Type": contentType, - }; + Map headers = {}; + if (type == HTTPType.PUT || type == HTTPType.POST) + headers["Content-Type"] = contentType; if (client.isLogged()) headers["Authorization"] = "Bearer ${client.accessToken}";