@@ -1135,23 +1151,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1169,16 +1168,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -1196,20 +1185,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1251,16 +1226,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -1295,13 +1260,6 @@
-
-
-
-
-
-
-
@@ -1380,13 +1338,6 @@
-
-
-
-
-
-
-
@@ -1451,16 +1402,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -1478,46 +1419,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1528,16 +1429,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index db310248..83a80483 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,4 +26,5 @@ gone.
with `Angel.eagerParseRequestBodies`.
* `Angel.storeOriginalBuffer` -> `Angel.storeRawRequestBuffers`.
* The methods `lazyBody`, `lazyFiles`, and `lazyOriginalBuffer` on `ResponseContext` were all
-replaced with `parseBody`, `parseUploadedFiles`, and `parseRawRequestBuffer`, respectively.
\ No newline at end of file
+replaced with `parseBody`, `parseUploadedFiles`, and `parseRawRequestBuffer`, respectively.
+* Removed the synchronous equivalents of the above methods (`body`, `files`, and `originalBuffer`).
\ No newline at end of file
diff --git a/lib/src/core/metadata.dart b/lib/src/core/metadata.dart
index 0fd38063..df549b85 100644
--- a/lib/src/core/metadata.dart
+++ b/lib/src/core/metadata.dart
@@ -91,7 +91,7 @@ class Parameter {
return req.headers.value(header) ?? defaultValue;
if (session?.isNotEmpty == true)
return req.session[session] ?? defaultValue;
- if (query?.isNotEmpty == true) return req.query[query] ?? defaultValue;
+ if (query?.isNotEmpty == true) return req.uri.queryParameters[query] ?? defaultValue;
return defaultValue;
}
}
diff --git a/lib/src/core/request_context.dart b/lib/src/core/request_context.dart
index dd0930b7..639ad73b 100644
--- a/lib/src/core/request_context.dart
+++ b/lib/src/core/request_context.dart
@@ -59,70 +59,15 @@ abstract class RequestContext {
/// The original HTTP verb sent to the server.
String get originalMethod;
- StateError _unparsed(String type, String caps) => new StateError(
- 'Cannot get the $type of an unparsed request. Use lazy${caps}() instead.');
-
- /// All post data submitted to the server.
- ///
- /// If you are lazy-parsing request bodies, but have not manually [parse]d this one,
- /// then an error will be thrown.
- ///
- /// **If you are writing a plug-in, use [parseBody] instead.**
- Map get body {
- if (_body == null)
- throw _unparsed('body', 'Body');
- else
- return _body.body;
- }
-
/// The content type of an incoming request.
MediaType get contentType;
- /// Any and all files sent to the server with this request.
- ///
- /// If you are lazy-parsing request bodies, but have not manually [parse]d this one,
- /// then an error will be thrown.
- ///
- /// **If you are writing a plug-in, use [parseUploadedFiles] instead.**
- List get files {
- if (_body == null)
- throw _unparsed('query', 'Files');
- else
- return _body.files;
- }
-
- /// The original body bytes sent with this request. May be empty.
- ///
- /// If you are lazy-parsing request bodies, but have not manually [parse]d this one,
- /// then an error will be thrown.
- ///
- /// **If you are writing a plug-in, use [parseRawRequestBuffer] instead.**
- List get originalBuffer {
- if (_body == null)
- throw _unparsed('original buffer', 'OriginalBuffer');
- else
- return _body.originalBuffer ?? [];
- }
-
/// The URL parameters extracted from the request URI.
Map params = {};
/// The requested path.
String get path;
- /// The parsed request query string.
- ///
- /// If you are lazy-parsing request bodies, but have not manually [parse]d this one,
- /// then [uri].query will be returned.
- ///
- /// **If you are writing a plug-in, consider using [lazyQuery] instead.**
- Map get query {
- if (_body == null)
- return _provisionalQuery ??= new Map.from(uri.queryParameters);
- else
- return _body.query;
- }
-
/// The remote address requesting this resource.
InternetAddress get remoteAddress;
@@ -223,7 +168,7 @@ abstract class RequestContext {
/// Retrieves the request body if it has already been parsed, or lazy-parses it before returning the query.
///
/// If [forceParse] is not `true`, then [uri].query will be returned, and no parsing will be performed.
- Future