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

Unified Diff: lib/src/io.dart

Issue 1340043004: Use GZIP on pub servers. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/io.dart
diff --git a/lib/src/io.dart b/lib/src/io.dart
index 952751c451bf9adb716ac7fa76fb90549be54f77..78b43afb02bc1c8e62a6376322889b5b827009c9 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -860,9 +860,12 @@ Future withTempDir(Future fn(String path)) {
///
/// If [host] is "localhost", this will automatically listen on both the IPv4
/// and IPv6 loopback addresses.
-Future<HttpServer> bindServer(String host, int port) {
- if (host == 'localhost') return HttpMultiServer.loopback(port);
- return HttpServer.bind(host, port);
+Future<HttpServer> bindServer(String host, int port) async {
+ var server = host == 'localhost'
+ ? await HttpMultiServer.loopback(port)
+ : await HttpServer.bind(host, port);
+ server.autoCompress = true;
+ return server;
}
/// Extracts a `.tar.gz` file from [stream] to [destination].
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698