Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: sdk/lib/io/http.dart

Issue 370743003: Add option to HttpClient to turn of auto uncompression (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review copmments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http.dart
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index b995137bb259b65c2fcf5a4bae56205a2c36ad56..896b1e4cff37e026a3515f9f3803263fe510bfed 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -1237,6 +1237,34 @@ abstract class HttpClient {
int maxConnectionsPerHost;
/**
+ * Get and set whether the body of a response will be automatically
+ * uncompressed.
+ *
+ * The body of an HTTP response can be compressed. In most
+ * situations providing the un-compressed body is most
+ * convenient. Therefore the default behavior is to un-compress the
+ * body. However in some situations (e.g. implementing a transparent
+ * proxy) keeping the uncompressed stream is required.
+ *
+ * NOTE: Headers in from the response is never modified. This means
+ * that when automatic un-compression is turned on the value of the
+ * header `Content-Length` will reflect the length of the original
+ * compressed body. Likewise the header `Content-Encoding` will also
+ * have the original value indicating compression.
+ *
+ * NOTE: Automatic un-compression is only performed if the
+ * `Content-Encoding` header value is `gzip`.
+ *
+ * This value affects all responses produced by this client after the
+ * value is changed.
+ *
+ * To disable, set to `false`.
+ *
+ * Default is `true`.
+ */
+ bool autoUncompress;
+
+ /**
* Set and get the default value of the `User-Agent` header for all requests
* generated by this [HttpClient]. The default value is
* `Dart/<version> (dart:io)`.
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698