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

Unified Diff: tests/standalone/io/http_server_test.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: 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
Index: tests/standalone/io/http_server_test.dart
diff --git a/tests/standalone/io/http_server_test.dart b/tests/standalone/io/http_server_test.dart
index f66450129265114cbf3b1cdb8a0a8152b38a9652..445fc5229a6e393736071f4eb870061c19b437fd 100644
--- a/tests/standalone/io/http_server_test.dart
+++ b/tests/standalone/io/http_server_test.dart
@@ -9,6 +9,20 @@ import "dart:io";
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
+void testDefaultResponseHeaders() {
Anders Johnsen 2014/08/08 06:15:45 Also test actual changing the headers, including e
Søren Gjesse 2014/08/11 14:10:09 Done.
+ HttpServer.bind("127.0.0.1", 0).then((server) {
+ Expect.listEquals(server.defaultResponseHeaders[HttpHeaders.CONTENT_TYPE],
+ ['text/plain; charset=utf-8']);
+ Expect.listEquals(server.defaultResponseHeaders['X-Frame-Options'],
+ ['SAMEORIGIN']);
+ Expect.listEquals(server.defaultResponseHeaders['X-Content-Type-Options'],
+ ['nosniff']);
+ Expect.listEquals(server.defaultResponseHeaders['X-XSS-Protection'],
+ ['1; mode=block']);
+ server.close();
+ });
+}
+
void testListenOn() {
ServerSocket socket;
HttpServer server;
@@ -137,6 +151,7 @@ void testHttpServerClientClose() {
void main() {
+ testDefaultResponseHeaders();
testListenOn();
testHttpServerZone();
testHttpServerZoneError();
« sdk/lib/io/http_impl.dart ('K') | « tests/standalone/io/http_server_response_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698