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

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

Issue 598453003: Add HttpServer:autoCompress option, to disable auto gzip compression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test. Created 6 years, 3 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
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index e0557e0c5954d6fbe249c9c4395fea7e5b977c5d..da5d2b6bc5c3c37287900d5513315aa0391f92ec 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -948,7 +948,9 @@ class _HttpOutgoing implements StreamConsumer<List<int>> {
bool gzip = false;
if (isServerSide) {
var response = outbound;
- if (outbound.bufferOutput && outbound.headers.chunkedTransferEncoding) {
+ if (response._httpRequest._httpServer.autoCompress &&
+ outbound.bufferOutput &&
+ outbound.headers.chunkedTransferEncoding) {
List acceptEncodings =
response._httpRequest.headers[HttpHeaders.ACCEPT_ENCODING];
List contentEncoding = outbound.headers[HttpHeaders.CONTENT_ENCODING];
@@ -2150,6 +2152,7 @@ class _HttpServer
String serverHeader;
final HttpHeaders defaultResponseHeaders = _initDefaultResponseHeaders();
+ bool autoCompress = false;
Duration _idleTimeout;
Timer _idleTimer;

Powered by Google App Engine
This is Rietveld 408576698