Skip to content

Commit ca730a3

Browse files
authored
Remove expectation that GET without a body has content-length 0. (#565)
See https://dart-review.googlesource.com/c/sdk/+/194881
1 parent 0757af4 commit ca730a3

File tree

3 files changed

+33
-34
lines changed

3 files changed

+33
-34
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.13.3-dev
2+
13
## 0.13.2
24

35
* Add `package:http/retry.dart` with `RetryClient`. This is the same

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: http
2-
version: 0.13.2
2+
version: 0.13.3-dev
33
homepage: https://github.com/dart-lang/http
44
description: A composable, multi-platform, Future-based API for HTTP requests.
55

test/io/http_test.dart

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,16 @@ void main() {
3030
expect(response.statusCode, equals(200));
3131
expect(
3232
response.body,
33-
parse(equals({
34-
'method': 'GET',
35-
'path': '/',
36-
'headers': {
37-
'content-length': ['0'],
38-
'accept-encoding': ['gzip'],
39-
'user-agent': ['Dart'],
40-
'x-random-header': ['Value'],
41-
'x-other-header': ['Other Value']
42-
},
43-
})));
33+
parse(allOf(
34+
containsPair('method', 'GET'),
35+
containsPair('path', '/'),
36+
containsPair(
37+
'headers',
38+
allOf(
39+
containsPair('accept-encoding', ['gzip']),
40+
containsPair('user-agent', ['Dart']),
41+
containsPair('x-random-header', ['Value']),
42+
containsPair('x-other-header', ['Other Value']))))));
4443
});
4544

4645
test('post', () async {
@@ -397,17 +396,16 @@ void main() {
397396
});
398397
expect(
399398
response,
400-
parse(equals({
401-
'method': 'GET',
402-
'path': '/',
403-
'headers': {
404-
'content-length': ['0'],
405-
'accept-encoding': ['gzip'],
406-
'user-agent': ['Dart'],
407-
'x-random-header': ['Value'],
408-
'x-other-header': ['Other Value']
409-
},
410-
})));
399+
parse(allOf(
400+
containsPair('method', 'GET'),
401+
containsPair('path', '/'),
402+
containsPair(
403+
'headers',
404+
allOf(
405+
containsPair('accept-encoding', ['gzip']),
406+
containsPair('user-agent', ['Dart']),
407+
containsPair('x-random-header', ['Value']),
408+
containsPair('x-other-header', ['Other Value']))))));
411409
});
412410

413411
test('read throws an error for a 4** status code', () {
@@ -423,17 +421,16 @@ void main() {
423421

424422
expect(
425423
String.fromCharCodes(bytes),
426-
parse(equals({
427-
'method': 'GET',
428-
'path': '/',
429-
'headers': {
430-
'content-length': ['0'],
431-
'accept-encoding': ['gzip'],
432-
'user-agent': ['Dart'],
433-
'x-random-header': ['Value'],
434-
'x-other-header': ['Other Value']
435-
},
436-
})));
424+
parse(allOf(
425+
containsPair('method', 'GET'),
426+
containsPair('path', '/'),
427+
containsPair(
428+
'headers',
429+
allOf(
430+
containsPair('accept-encoding', ['gzip']),
431+
containsPair('user-agent', ['Dart']),
432+
containsPair('x-random-header', ['Value']),
433+
containsPair('x-other-header', ['Other Value']))))));
437434
});
438435

439436
test('readBytes throws an error for a 4** status code', () {

0 commit comments

Comments
 (0)