2.0.0-alpha.20
This commit is contained in:
parent
3f9e94b12a
commit
b0ecac3232
4 changed files with 18 additions and 12 deletions
|
@ -1,3 +1,6 @@
|
|||
# 2.0.0-alpha.20
|
||||
* Inject the `MiddlewarePipeline` into requests.
|
||||
|
||||
# 2.0.0-alpha.19
|
||||
* `parseBody` checks for null content type, and throws a `400` if none was given.
|
||||
* Add `ResponseContext.contentLength`.
|
||||
|
|
|
@ -97,17 +97,18 @@ abstract class Driver<
|
|||
var path = req.path;
|
||||
if (path == '/') path = '';
|
||||
|
||||
Tuple3<List, Map<String, dynamic>, ParseResult<Map<String, dynamic>>>
|
||||
resolveTuple() {
|
||||
Tuple4<List, Map<String, dynamic>, ParseResult<Map<String, dynamic>>,
|
||||
MiddlewarePipeline> resolveTuple() {
|
||||
Router r = app.optimizedRouter;
|
||||
var resolved =
|
||||
r.resolveAbsolute(path, method: req.method, strip: false);
|
||||
|
||||
return new Tuple3(
|
||||
new MiddlewarePipeline(resolved).handlers,
|
||||
var pipeline = new MiddlewarePipeline(resolved);
|
||||
return new Tuple4(
|
||||
pipeline.handlers,
|
||||
resolved.fold<Map<String, dynamic>>(
|
||||
<String, dynamic>{}, (out, r) => out..addAll(r.allParams)),
|
||||
resolved.isEmpty ? null : resolved.first.parseResult,
|
||||
pipeline,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -118,9 +119,10 @@ abstract class Driver<
|
|||
|
||||
req.params.addAll(tuple.item2);
|
||||
|
||||
req.container.registerSingleton<ParseResult<Map<String, dynamic>>>(
|
||||
tuple.item3);
|
||||
req.container.registerSingleton<ParseResult>(tuple.item3);
|
||||
req.container
|
||||
..registerSingleton<MiddlewarePipeline>(tuple.item4)
|
||||
..registerSingleton<ParseResult<Map<String, dynamic>>>(tuple.item3)
|
||||
..registerSingleton<ParseResult>(tuple.item3);
|
||||
|
||||
if (!app.isProduction && app.logger != null) {
|
||||
req.container
|
||||
|
|
|
@ -36,9 +36,10 @@ class Angel extends Routable {
|
|||
(String view, [Map data]) => 'No view engine has been configured yet.';
|
||||
|
||||
final List<Angel> _children = [];
|
||||
final Map<String,
|
||||
Tuple3<List, Map<String, dynamic>, ParseResult<Map<String, dynamic>>>>
|
||||
handlerCache = new HashMap();
|
||||
final Map<
|
||||
String,
|
||||
Tuple4<List, Map<String, dynamic>, ParseResult<Map<String, dynamic>>,
|
||||
MiddlewarePipeline>> handlerCache = new HashMap();
|
||||
|
||||
Router _flattened;
|
||||
bool _isProduction;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: angel_framework
|
||||
version: 2.0.0-alpha.19
|
||||
version: 2.0.0-alpha.20
|
||||
description: A high-powered HTTP server with dependency injection, routing and much more.
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/angel_framework
|
||||
|
|
Loading…
Reference in a new issue