| Index: pkg/http_server/test/utils.dart
|
| diff --git a/pkg/http_server/test/utils.dart b/pkg/http_server/test/utils.dart
|
| index d9e67a8daefa79fd58b03605775775112ac55e99..898cf31e1ecea9cb1b4529c918ccf3b189177257 100644
|
| --- a/pkg/http_server/test/utils.dart
|
| +++ b/pkg/http_server/test/utils.dart
|
| @@ -27,12 +27,14 @@ Future<int> getStatusCodeForVirtDir(VirtualDirectory virtualDir,
|
| {String host,
|
| bool secure: false,
|
| DateTime ifModifiedSince,
|
| - bool rawPath: false}) {
|
| + bool rawPath: false,
|
| + bool followRedirects: true}) {
|
| return _withServer((server) {
|
|
|
| virtualDir.serve(server);
|
| return getStatusCode(server.port, path, host: host, secure: secure,
|
| - ifModifiedSince: ifModifiedSince, rawPath: rawPath);
|
| + ifModifiedSince: ifModifiedSince, rawPath: rawPath,
|
| + followRedirects: followRedirects);
|
| });
|
| }
|
|
|
| @@ -41,7 +43,8 @@ Future<int> getStatusCode(int port,
|
| {String host,
|
| bool secure: false,
|
| DateTime ifModifiedSince,
|
| - bool rawPath: false}) {
|
| + bool rawPath: false,
|
| + bool followRedirects: true}) {
|
| Uri uri;
|
| if (rawPath) {
|
| uri = new Uri(scheme: secure ? 'https' : 'http',
|
| @@ -56,6 +59,7 @@ Future<int> getStatusCode(int port,
|
|
|
| return new HttpClient().getUrl(uri)
|
| .then((request) {
|
| + if (!followRedirects) request.followRedirects = false;
|
| if (host != null) request.headers.host = host;
|
| if (ifModifiedSince != null) {
|
| request.headers.ifModifiedSince = ifModifiedSince;
|
|
|