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; |