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

Unified Diff: pkg/shelf/test/shelf_io_test.dart

Issue 281353004: pkg/shelf: Fixed logic for setting Server header in `shelf_io` (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final nits Created 6 years, 7 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 | « pkg/shelf/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/shelf_io_test.dart
diff --git a/pkg/shelf/test/shelf_io_test.dart b/pkg/shelf/test/shelf_io_test.dart
index c7d9f7a78d5ea449d2fda53bee17fb9703db65dc..b3b43258a98458f6443735655757270709240db4 100644
--- a/pkg/shelf/test/shelf_io_test.dart
+++ b/pkg/shelf/test/shelf_io_test.dart
@@ -284,6 +284,28 @@ void main() {
});
});
});
+
+ group('server header', () {
+ test('defaults to "dart:io with Shelf"', () {
+ _scheduleServer(syncHandler);
+
+ return _scheduleGet().then((response) {
+ expect(response.headers,
+ containsPair(HttpHeaders.SERVER, 'dart:io with Shelf'));
+ });
+ });
+
+ test('defers to header in response', () {
+ _scheduleServer((request) {
+ return new Response.ok('test',
+ headers: {HttpHeaders.SERVER: 'myServer'});
+ });
+
+ return _scheduleGet().then((response) {
+ expect(response.headers, containsPair(HttpHeaders.SERVER, 'myServer'));
+ });
+ });
+ });
}
int _serverPort;
« no previous file with comments | « pkg/shelf/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698