Skip to content

Commit ebd0b33

Browse files
donny-dontnex3
authored andcommitted
Fix content-length-header (#110)
1 parent e1533c4 commit ebd0b33

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/src/io_client.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ class IOClient extends BaseClient {
3131
ioRequest
3232
..followRedirects = context['io.followRedirects'] ?? true
3333
..maxRedirects = context['io.maxRedirects'] ?? 5
34-
..contentLength = request.contentLength == null
35-
? -1
36-
: request.contentLength
3734
..persistentConnection = context['io.persistentConnection'] ?? true;
3835
request.headers.forEach((name, value) {
3936
ioRequest.headers.set(name, value);

test/client_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ void main() {
330330
'method': 'DELETE',
331331
'path': '/',
332332
'headers': {
333+
'content-length': ['0'],
333334
'user-agent': [userAgent()],
334335
'x-random-header': ['Value'],
335336
'x-other-header': ['Other Value']

0 commit comments

Comments
 (0)