diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml index 37425f8a..ec70caa9 100644 --- a/.idea/libraries/Dart_Packages.xml +++ b/.idea/libraries/Dart_Packages.xml @@ -12,7 +12,7 @@ - @@ -33,7 +33,7 @@ - @@ -454,10 +454,10 @@ - + - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2b2b93be..30b0eae6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,8 @@ - - + + @@ -27,32 +27,11 @@ - - - - - - - - - - - - - - - - - - - - - - + - - + + @@ -60,35 +39,11 @@ - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + @@ -231,13 +186,10 @@ @@ -266,9 +221,9 @@ - @@ -672,35 +627,7 @@ - - - - 1531146512450 - - - 1531147206687 - - - 1531147434255 - - - 1531147799220 - 1531148090824 @@ -1017,7 +944,35 @@ - @@ -1053,7 +1008,7 @@ - @@ -1065,7 +1020,7 @@ - + @@ -1084,13 +1039,14 @@ + - + @@ -1103,7 +1059,6 @@ - @@ -1116,10 +1071,6 @@ @@ -1170,13 +1125,6 @@ - - - - - - - @@ -1279,13 +1227,6 @@ - - - - - - - @@ -1343,26 +1284,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -1425,70 +1346,101 @@ + + + + + + + + + + + + + + - - + + - + - - - - - - - - - - - - - - - - - - - + + - + - - + + + + + - + - - - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/src/http/http_request_context.dart b/lib/src/http/http_request_context.dart index d0a1b028..2e71dd26 100644 --- a/lib/src/http/http_request_context.dart +++ b/lib/src/http/http_request_context.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:io'; +import 'package:angel_container/angel_container.dart'; import 'package:body_parser/body_parser.dart'; import 'package:http_parser/http_parser.dart'; @@ -8,10 +9,14 @@ import '../core/core.dart'; /// An implementation of [RequestContext] that wraps a [HttpRequest]. class HttpRequestContext extends RequestContext { + Container _container; MediaType _contentType; HttpRequest _io; String _override, _path; + @override + Container get container => _container; + @override MediaType get contentType { return _contentType; @@ -77,7 +82,8 @@ class HttpRequestContext extends RequestContext { /// Magically transforms an [HttpRequest] into a [RequestContext]. static Future from( HttpRequest request, Angel app, String path) { - HttpRequestContext ctx = new HttpRequestContext(); + HttpRequestContext ctx = new HttpRequestContext() + .._container = app.container.createChild(); String override = request.method; diff --git a/pubspec.yaml b/pubspec.yaml index d0446987..ca44a078 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: angel_container: ^1.0.0-alpha angel_http_exception: ^1.0.0 angel_model: ^1.0.0 - angel_route: ^2.0.0 + angel_route: ^3.0.0 body_parser: ^1.0.0 charcode: ^1.0.0 combinator: ^1.0.0