Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5ffff98

Browse files
tvolkertcommit-bot@chromium.org
authored andcommitted
Add autoUncompress to _HttpClientResponse
Bug: dartbug.com/36971 Change-Id: I5f35c26f705591330d7e777773d5595e0978d3e0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102780 Reviewed-by: Zach Anderson <[email protected]> Commit-Queue: Todd Volkert <[email protected]>
1 parent 86c7165 commit 5ffff98

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sdk/lib/_http/http_impl.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,13 @@ class _HttpClientResponse extends _HttpInboundMessage
292292
// The HttpClientRequest of this response.
293293
final _HttpClientRequest _httpRequest;
294294

295+
// Whether this response is configured to auto uncompress.
296+
final bool autoUncompress;
297+
295298
_HttpClientResponse(
296299
_HttpIncoming _incoming, this._httpRequest, this._httpClient)
297-
: super(_incoming) {
300+
: autoUncompress = _httpClient.autoUncompress,
301+
super(_incoming) {
298302
// Set uri for potential exceptions.
299303
_incoming.uri = _httpRequest.uri;
300304
}
@@ -377,7 +381,7 @@ class _HttpClientResponse extends _HttpInboundMessage
377381
return new Stream<List<int>>.empty().listen(null, onDone: onDone);
378382
}
379383
Stream<List<int>> stream = _incoming;
380-
if (_httpClient.autoUncompress &&
384+
if (autoUncompress &&
381385
headers.value(HttpHeaders.contentEncodingHeader) == "gzip") {
382386
stream = stream.transform(gzip.decoder);
383387
}

0 commit comments

Comments
 (0)