OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.utils; | |
6 | |
7 import 'dart:async'; | 5 import 'dart:async'; |
8 import 'dart:convert'; | 6 import 'dart:convert'; |
9 import 'dart:math' as math; | 7 import 'dart:math' as math; |
10 | 8 |
11 import 'package:async/async.dart' hide StreamQueue; | 9 import 'package:async/async.dart' hide StreamQueue; |
12 import 'package:crypto/crypto.dart'; | 10 import 'package:crypto/crypto.dart'; |
13 import 'package:path/path.dart' as p; | 11 import 'package:path/path.dart' as p; |
14 import 'package:shelf/shelf.dart' as shelf; | 12 import 'package:shelf/shelf.dart' as shelf; |
15 import 'package:stack_trace/stack_trace.dart'; | 13 import 'package:stack_trace/stack_trace.dart'; |
16 | 14 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 urlSafe: urlSafe, addLineSeparator: addLineSeparator); | 419 urlSafe: urlSafe, addLineSeparator: addLineSeparator); |
422 } | 420 } |
423 | 421 |
424 /// Returns middleware that nests all requests beneath the URL prefix [beneath]. | 422 /// Returns middleware that nests all requests beneath the URL prefix [beneath]. |
425 shelf.Middleware nestingMiddleware(String beneath) { | 423 shelf.Middleware nestingMiddleware(String beneath) { |
426 return (handler) { | 424 return (handler) { |
427 var pathHandler = new PathHandler()..add(beneath, handler); | 425 var pathHandler = new PathHandler()..add(beneath, handler); |
428 return pathHandler.handler; | 426 return pathHandler.handler; |
429 }; | 427 }; |
430 } | 428 } |
OLD | NEW |