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

Unified Diff: sdk/lib/io/http.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 | « no previous file | sdk/lib/io/http_headers.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 896b1e4cff37e026a3515f9f3803263fe510bfed..6f5eb5699c845d0caa6d062f9058d4f47a3657f1 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -164,6 +164,21 @@ abstract class HttpServer implements Stream<HttpRequest> {
String serverHeader;
/**
+ * Default set of headers added to all response objects.
+ *
+ * By default the following headers are in this set:
+ *
+ * Content-Type: text/plain; charset=utf-8
+ * X-Frame-Options: SAMEORIGIN
+ * X-Content-Type-Options: nosniff
+ * X-XSS-Protection: 1; mode=block
+ *
+ * If the `Server` header is added here and the `serverHeader` is set as
+ * well then the value of `serverHeader` takes precedence.
+ */
+ HttpHeaders get defaultResponseHeaders;
+
+ /**
* Get or set the timeout used for idle keep-alive connections. If no further
* request is seen within [idleTimeout] after the previous request was
* completed, the connection is dropped.
@@ -580,6 +595,13 @@ abstract class HttpHeaders {
* 'set-cookie' header has folding disabled by default.
*/
void noFolding(String name);
+
+ /**
+ * Remove all headers. Some headers have system supplied values and
+ * for these the system supplied values will still be added to the
+ * collection of values for the header.
+ */
+ void clear();
}
@@ -813,6 +835,8 @@ abstract class Cookie {
/**
* Creates a new cookie optionally setting the name and value.
+ *
+ * By default the value of `httpOnly` will be set to `true`.
*/
factory Cookie([String name, String value]) => new _Cookie(name, value);
« no previous file with comments | « no previous file | sdk/lib/io/http_headers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698