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

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

Issue 443373003: Make the default HTTP server configuration more secure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed more review comments Created 6 years, 4 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 | « sdk/lib/io/http.dart ('k') | 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 f621fff07fa1fc8e4246393737fc110480e49b4d..4609ac49df3c7668ef75080c3db2760a210516a5 100644
--- a/sdk/lib/io/http_headers.dart
+++ b/sdk/lib/io/http_headers.dart
@@ -20,11 +20,21 @@ class _HttpHeaders implements HttpHeaders {
final int _defaultPortForScheme;
_HttpHeaders(this.protocolVersion,
- {int defaultPortForScheme: HttpClient.DEFAULT_HTTP_PORT})
+ {int defaultPortForScheme: HttpClient.DEFAULT_HTTP_PORT,
+ _HttpHeaders initialHeaders})
: _headers = new HashMap<String, List<String>>(),
_defaultPortForScheme = defaultPortForScheme {
+ if (initialHeaders != null) {
+ initialHeaders._headers.forEach((name, value) => _headers[name] = value);
+ _contentLength = initialHeaders._contentLength;
+ _persistentConnection = initialHeaders._persistentConnection;
+ _chunkedTransferEncoding = initialHeaders._chunkedTransferEncoding;
+ _host = initialHeaders._host;
+ _port = initialHeaders._port;
+ }
if (protocolVersion == "1.0") {
_persistentConnection = false;
+ _chunkedTransferEncoding = false;
}
}
@@ -252,6 +262,16 @@ class _HttpHeaders implements HttpHeaders {
_set(HttpHeaders.CONTENT_TYPE, contentType.toString());
}
+ void clear() {
+ _checkMutable();
+ _headers.clear();
+ _contentLength = -1;
+ _persistentConnection = true;
+ _chunkedTransferEncoding = false;
+ _host = null;
+ _port = null;
+ }
+
// [name] must be a lower-case version of the name.
void _add(String name, value) {
assert(name == _validateField(name));
@@ -801,6 +821,8 @@ class _Cookie implements Cookie {
bool secure = false;
_Cookie([this.name, this.value]) {
+ // Default value of httponly is true.
+ httpOnly = true;
_validate();
}
« no previous file with comments | « sdk/lib/io/http.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698