From ebd0b336cd4b0edc35218b6eb0e1bf4d72461894 Mon Sep 17 00:00:00 2001 From: Don Date: Wed, 20 Sep 2017 16:13:01 -0700 Subject: [PATCH] Fix content-length-header (#110) --- lib/src/io_client.dart | 3 --- test/client_test.dart | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/io_client.dart b/lib/src/io_client.dart index 99d52c4e1e..6b2b52039f 100644 --- a/lib/src/io_client.dart +++ b/lib/src/io_client.dart @@ -31,9 +31,6 @@ class IOClient extends BaseClient { ioRequest ..followRedirects = context['io.followRedirects'] ?? true ..maxRedirects = context['io.maxRedirects'] ?? 5 - ..contentLength = request.contentLength == null - ? -1 - : request.contentLength ..persistentConnection = context['io.persistentConnection'] ?? true; request.headers.forEach((name, value) { ioRequest.headers.set(name, value); diff --git a/test/client_test.dart b/test/client_test.dart index a8e466d0e6..6f09fab035 100644 --- a/test/client_test.dart +++ b/test/client_test.dart @@ -330,6 +330,7 @@ void main() { 'method': 'DELETE', 'path': '/', 'headers': { + 'content-length': ['0'], 'user-agent': [userAgent()], 'x-random-header': ['Value'], 'x-other-header': ['Other Value']