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

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

Issue 208333015: Don't add ':443' to host header, when the connection is secure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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_headers.dart
diff --git a/sdk/lib/io/http_headers.dart b/sdk/lib/io/http_headers.dart
index bd56939cb3d249eb55efc24a0ee6c5c7550c2687..5dd5c55fd064e50f44e9c3e7d43047a2c3dc0518 100644
--- a/sdk/lib/io/http_headers.dart
+++ b/sdk/lib/io/http_headers.dart
@@ -17,8 +17,12 @@ class _HttpHeaders implements HttpHeaders {
String _host;
int _port;
- _HttpHeaders(this.protocolVersion)
- : _headers = new HashMap<String, List<String>>() {
+ final int _defaultPortForScheme;
+
+ _HttpHeaders(this.protocolVersion,
+ {int defaultPortForScheme: HttpClient.DEFAULT_HTTP_PORT})
+ : _headers = new HashMap<String, List<String>>(),
+ _defaultPortForScheme = defaultPortForScheme {
if (protocolVersion == "1.0") {
_persistentConnection = false;
}
@@ -368,7 +372,7 @@ class _HttpHeaders implements HttpHeaders {
}
_updateHostHeader() {
- bool defaultPort = _port == null || _port == HttpClient.DEFAULT_HTTP_PORT;
+ bool defaultPort = _port == null || _port == _defaultPortForScheme;
String portPart = defaultPort ? "" : ":$_port";
_set("host", "$host$portPart");
}
« 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