Update query parsing

This commit is contained in:
Tobe O 2018-08-20 00:09:54 -04:00
parent 1dec4f3da6
commit c2ee694cc3
6 changed files with 324 additions and 340 deletions

View file

@ -3,7 +3,11 @@
<component name="ChangeListManager">
<list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/response_context.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/response_context.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/metadata.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/metadata.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/request_context.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/request_context.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/service.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/service.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/routing_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/routing_test.dart" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" />
@ -26,13 +30,67 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="response_context.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart">
<file leaf-file-name="main.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1261">
<caret line="306" column="38" selection-start-line="306" selection-start-column="38" selection-end-line="306" selection-end-column="38" />
<state relative-caret-position="304">
<caret line="19" column="38" selection-start-line="19" selection-start-column="38" selection-end-line="19" selection-end-column="38" />
<folding>
<element signature="e#48#68#0" expanded="true" />
<element signature="e#0#46#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="routing_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="83" column="22" lean-forward="true" selection-start-line="83" selection-start-column="22" selection-end-line="83" selection-end-column="44" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="metadata.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/core/metadata.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152">
<caret line="93" column="65" selection-start-line="93" selection-start-column="65" selection-end-line="93" selection-end-column="65" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="http_request_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="9" column="42" selection-start-line="9" selection-start-column="42" selection-end-line="9" selection-end-column="42" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="464">
<caret line="29" column="99" selection-start-line="29" selection-start-column="99" selection-end-line="29" selection-end-column="99" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="request_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="172" column="28" selection-start-line="172" selection-start-column="28" selection-end-line="172" selection-end-column="28" />
<folding>
<element signature="e#47#67#0" expanded="true" />
</folding>
</state>
</provider>
@ -41,8 +99,8 @@
<file leaf-file-name="service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2042">
<caret line="128" column="5" lean-forward="true" selection-start-line="128" selection-start-column="5" selection-end-line="128" selection-end-column="5" />
<state relative-caret-position="140">
<caret line="257" column="28" lean-forward="true" selection-start-line="257" selection-start-column="28" selection-end-line="257" selection-end-column="28" />
<folding>
<element signature="e#39#59#0" expanded="true" />
</folding>
@ -50,48 +108,6 @@
</provider>
</entry>
</file>
<file leaf-file-name="request_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="406">
<caret line="158" column="23" lean-forward="true" selection-start-line="158" selection-start-column="23" selection-end-line="158" selection-end-column="23" />
<folding>
<element signature="e#47#67#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="http_request_context.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="160">
<caret line="10" column="25" lean-forward="true" selection-start-line="10" selection-start-column="25" selection-end-line="10" selection-end-column="25" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="hooked_service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/hooked_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="390">
<caret line="555" column="35" selection-start-line="555" selection-start-column="35" selection-end-line="555" selection-end-column="35" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="anonymous_service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/anonymous_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="80">
<caret line="6" column="36" selection-start-line="6" selection-start-column="36" selection-end-line="6" selection-end-column="36" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
@ -104,11 +120,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>redirectTo</find>
<find>finalizers.t</find>
<find>`Iterable`</find>
<find>instance</find>
<find>==</find>
<find>as Map&lt;String, dynamic&gt;</find>
<find>result as Map&lt;String, dynamic&gt;</find>
<find>random_strin</find>
@ -132,11 +143,15 @@
<find>package:dart:io</find>
<find>deprecated</find>
<find>parse</find>
<find>io.</find>
<find>io</find>
<find>io.</find>
<find>lazyP</find>
<find>storeO</find>
<find>origina</find>
<find>originalBuffer</find>
<find>lazyQue</find>
</findStrings>
<replaceStrings>
<replace>isClosed</replace>
<replace>useStream</replace>
<replace>streaming</replace>
<replace>!isOpen</replace>
@ -166,6 +181,7 @@
<replace>dart:io</replace>
<replace>json.decode</replace>
<replace>rawRequest.</replace>
<replace>rawResponse.</replace>
</replaceStrings>
<dirStrings>
<dir>C:\Users\thosa\Source\Angel\framework\lib</dir>
@ -189,8 +205,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/lib/src/stats/metric_server.dart" />
<option value="$PROJECT_DIR$/lib/src/util.dart" />
<option value="$PROJECT_DIR$/lib/src/http/controller.dart" />
<option value="$PROJECT_DIR$/test/exception_test.dart" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_http_exception-1.0.0/lib/angel_http_exception.dart" />
@ -201,13 +215,9 @@
<option value="$PROJECT_DIR$/lib/src/core/anonymous_service.dart" />
<option value="$PROJECT_DIR$/test/find_one_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/map_service.dart" />
<option value="$PROJECT_DIR$/example/json.dart" />
<option value="$PROJECT_DIR$/example/main.dart" />
<option value="$PROJECT_DIR$/example/view.dart" />
<option value="$PROJECT_DIR$/test/precontained_test.dart" />
<option value="$PROJECT_DIR$/test/repeat_request_test.dart" />
<option value="$PROJECT_DIR$/test/parameter_meta_test.dart" />
<option value="$PROJECT_DIR$/test/routing_test.dart" />
<option value="$PROJECT_DIR$/test/server_test.dart" />
<option value="$PROJECT_DIR$/test/streaming_test.dart" />
<option value="$PROJECT_DIR$/test/view_generator_test.dart" />
@ -215,7 +225,6 @@
<option value="$PROJECT_DIR$/test/di_test.dart" />
<option value="$PROJECT_DIR$/test/accepts_test.dart" />
<option value="$PROJECT_DIR$/test/encoders_buffer_test.dart" />
<option value="$PROJECT_DIR$/performance/hello/main.dart" />
<option value="$PROJECT_DIR$/test/general_test.dart" />
<option value="$PROJECT_DIR$/example/templating.dart" />
<option value="$PROJECT_DIR$/test/serialize_test.dart" />
@ -225,7 +234,6 @@
<option value="$PROJECT_DIR$/test/services_test.dart" />
<option value="$PROJECT_DIR$/test/hooked_test.dart" />
<option value="$PROJECT_DIR$/test/all.dart" />
<option value="$PROJECT_DIR$/example/handle_error.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/core/angel_base.dart" />
<option value="$PROJECT_DIR$/lib/src/core/core.dart" />
@ -233,13 +241,21 @@
<option value="$PROJECT_DIR$/lib/src/core/routable.dart" />
<option value="$PROJECT_DIR$/test/primitives_test.dart" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http.dart" />
<option value="$PROJECT_DIR$/lib/src/core/server.dart" />
<option value="$PROJECT_DIR$/lib/src/core/hooked_service.dart" />
<option value="$PROJECT_DIR$/lib/src/core/service.dart" />
<option value="$PROJECT_DIR$/lib/src/core/request_context.dart" />
<option value="$PROJECT_DIR$/lib/src/http/http_request_context.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/src/core/response_context.dart" />
<option value="$PROJECT_DIR$/lib/src/http/http_response_context.dart" />
<option value="$PROJECT_DIR$/example/handle_error.dart" />
<option value="$PROJECT_DIR$/example/json.dart" />
<option value="$PROJECT_DIR$/performance/hello/main.dart" />
<option value="$PROJECT_DIR$/test/parameter_meta_test.dart" />
<option value="$PROJECT_DIR$/lib/src/http/http_request_context.dart" />
<option value="$PROJECT_DIR$/lib/src/core/server.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/src/core/request_context.dart" />
<option value="$PROJECT_DIR$/lib/src/core/service.dart" />
<option value="$PROJECT_DIR$/example/main.dart" />
<option value="$PROJECT_DIR$/test/routing_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/metadata.dart" />
</list>
</option>
</component>
@ -658,35 +674,7 @@
<workItem from="1533353660185" duration="262000" />
<workItem from="1534009494986" duration="594000" />
<workItem from="1534546784803" duration="353000" />
<workItem from="1534547885788" duration="7562000" />
</task>
<task id="LOCAL-00085" summary="1.1.4+1">
<created>1528442409476</created>
<option name="number" value="00085" />
<option name="presentableId" value="LOCAL-00085" />
<option name="project" value="LOCAL" />
<updated>1528442409476</updated>
</task>
<task id="LOCAL-00086" summary="1.1.4+2">
<created>1528670046042</created>
<option name="number" value="00086" />
<option name="presentableId" value="LOCAL-00086" />
<option name="project" value="LOCAL" />
<updated>1528670046044</updated>
</task>
<task id="LOCAL-00087" summary="Fix async bugs">
<created>1528672631391</created>
<option name="number" value="00087" />
<option name="presentableId" value="LOCAL-00087" />
<option name="project" value="LOCAL" />
<updated>1528672631392</updated>
</task>
<task id="LOCAL-00088" summary="Fix hooking bug">
<created>1529523884120</created>
<option name="number" value="00088" />
<option name="presentableId" value="LOCAL-00088" />
<option name="project" value="LOCAL" />
<updated>1529523884121</updated>
<workItem from="1534547885788" duration="9329000" />
</task>
<task id="LOCAL-00089" summary="+5">
<created>1529724578292</created>
@ -1003,7 +991,35 @@
<option name="project" value="LOCAL" />
<updated>1534735919739</updated>
</task>
<option name="localTasksCounter" value="134" />
<task id="LOCAL-00134" summary="Completely remove ResponseContext.io">
<created>1534736377619</created>
<option name="number" value="00134" />
<option name="presentableId" value="LOCAL-00134" />
<option name="project" value="LOCAL" />
<updated>1534736377619</updated>
</task>
<task id="LOCAL-00135" summary="Rename HTTP request+response impl, drop the &quot;impl&quot;">
<created>1534736459394</created>
<option name="number" value="00135" />
<option name="presentableId" value="LOCAL-00135" />
<option name="project" value="LOCAL" />
<updated>1534736459394</updated>
</task>
<task id="LOCAL-00136" summary="Make lazy parsing the default">
<created>1534736798816</created>
<option name="number" value="00136" />
<option name="presentableId" value="LOCAL-00136" />
<option name="project" value="LOCAL" />
<updated>1534736798816</updated>
</task>
<task id="LOCAL-00137" summary="Rename body parsing methods">
<created>1534737069329</created>
<option name="number" value="00137" />
<option name="presentableId" value="LOCAL-00137" />
<option name="project" value="LOCAL" />
<updated>1534737069329</updated>
</task>
<option name="localTasksCounter" value="138" />
<servers />
</component>
<component name="TestHistory">
@ -1039,7 +1055,7 @@
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="169861000" />
<option name="totallyTimeSpent" value="171628000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -1059,7 +1075,7 @@
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.5035524" side_tool="true" weight="0.34188035" />
<window_info anchor="right" id="Maven Projects" order="3" />
<window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
<window_info anchor="bottom" id="Dart Analysis" order="7" weight="0.31004366" />
<window_info active="true" anchor="bottom" id="Dart Analysis" order="7" visible="true" weight="0.31004366" />
<window_info anchor="right" id="Flutter Outline" order="4" />
<window_info id="Capture Tool" order="2" />
<window_info id="Designer" order="2" />
@ -1077,7 +1093,7 @@
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.4964476" weight="0.3973799" />
<window_info anchor="bottom" id="Version Control" order="7" weight="0.32905984" />
<window_info anchor="bottom" id="Terminal" order="7" weight="0.44978166" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.27920645" />
<window_info content_ui="combo" id="Project" order="0" weight="0.27920645" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32905984" />
<window_info anchor="right" id="SciView" order="4" />
<window_info anchor="right" id="Theme Preview" order="3" />
@ -1102,10 +1118,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value="Patched another cast bug" />
<MESSAGE value="Removed random_string dependency" />
<MESSAGE value="Switch to MediaType" />
<MESSAGE value="Begin 2.0.0-alpha" />
<MESSAGE value="Change signature of ResponseContext.jsonp" />
<MESSAGE value="Changed view engine to use `Map&lt;String, dynamic&gt;`" />
<MESSAGE value="Strip out json god" />
@ -1127,7 +1139,11 @@
<MESSAGE value="Make parseId static + docs" />
<MESSAGE value="Make RequestContext generic" />
<MESSAGE value="Completely remove RequestContext.io" />
<option name="LAST_COMMIT_MESSAGE" value="Completely remove RequestContext.io" />
<MESSAGE value="Completely remove ResponseContext.io" />
<MESSAGE value="Rename HTTP request+response impl, drop the &quot;impl&quot;" />
<MESSAGE value="Make lazy parsing the default" />
<MESSAGE value="Rename body parsing methods" />
<option name="LAST_COMMIT_MESSAGE" value="Rename body parsing methods" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -1135,23 +1151,6 @@
</breakpoint-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.3/lib/src/core_matchers.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="86">
<caret line="116" column="8" selection-start-line="116" selection-start-column="8" selection-end-line="116" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/find_one_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="288">
<caret line="18" column="52" selection-start-line="18" selection-start-column="52" selection-end-line="18" selection-end-column="52" />
<folding>
<element signature="e#0#54#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/anonymous_service_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="528">
@ -1169,16 +1168,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/json.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="16">
<caret line="31" column="22" selection-start-line="31" selection-start-column="22" selection-end-line="31" selection-end-column="40" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/precontained_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="81">
@ -1196,20 +1185,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="336">
<caret line="30" column="20" selection-start-line="30" selection-start-column="20" selection-end-line="30" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="30" column="20" selection-start-line="30" selection-start-column="20" selection-end-line="30" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/server_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="112">
@ -1251,16 +1226,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="64">
<caret line="4" column="42" selection-start-line="4" selection-start-column="42" selection-end-line="4" selection-end-column="42" />
<folding>
<element signature="e#0#46#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/view.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
@ -1295,13 +1260,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/performance/hello/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="336">
<caret line="25" column="22" selection-start-line="25" selection-start-column="22" selection-end-line="25" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
@ -1380,13 +1338,6 @@
<entry file="file://$PROJECT_DIR$/lib/src/core/typed_service.dart">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="64">
<caret line="8" column="28" lean-forward="true" selection-start-line="8" selection-start-column="28" selection-end-line="8" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/angel_base.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="128">
@ -1451,16 +1402,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2042">
<caret line="128" column="5" lean-forward="true" selection-start-line="128" selection-start-column="5" selection-end-line="128" selection-end-column="5" />
<folding>
<element signature="e#39#59#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/controller_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="608">
@ -1478,46 +1419,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="160">
<caret line="10" column="25" lean-forward="true" selection-start-line="10" selection-start-column="25" selection-end-line="10" selection-end-column="25" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="336">
<caret line="21" column="5" selection-start-line="21" selection-start-column="5" selection-end-line="21" selection-end-column="5" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="406">
<caret line="158" column="23" lean-forward="true" selection-start-line="158" selection-start-column="23" selection-end-line="158" selection-end-column="23" />
<folding>
<element signature="e#47#67#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="137" column="16" selection-start-line="137" selection-start-column="16" selection-end-line="137" selection-end-column="16" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
@ -1528,16 +1429,131 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1368">
<caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/json.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="656">
<caret line="41" column="5" selection-start-line="41" selection-start-column="5" selection-end-line="41" selection-end-column="5" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="48">
<caret line="7" column="52" selection-start-line="7" selection-start-column="52" selection-end-line="7" selection-end-column="52" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-5">
<caret line="55" column="71" lean-forward="true" selection-start-line="55" selection-start-column="71" selection-end-line="55" selection-end-column="71" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1261">
<caret line="306" column="38" selection-start-line="306" selection-start-column="38" selection-end-line="306" selection-end-column="38" />
<state relative-caret-position="5223">
<caret line="361" column="36" lean-forward="true" selection-start-line="361" selection-start-column="36" selection-end-line="361" selection-end-column="36" />
<folding>
<element signature="e#48#68#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/performance/hello/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="294">
<caret line="25" column="53" selection-start-line="25" selection-start-column="53" selection-end-line="25" selection-end-column="53" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="336">
<caret line="30" column="50" selection-start-line="30" selection-start-column="50" selection-end-line="30" selection-end-column="50" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="464">
<caret line="29" column="99" selection-start-line="29" selection-start-column="99" selection-end-line="29" selection-end-column="99" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="9" column="42" selection-start-line="9" selection-start-column="42" selection-end-line="9" selection-end-column="42" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="140">
<caret line="257" column="28" lean-forward="true" selection-start-line="257" selection-start-column="28" selection-end-line="257" selection-end-column="28" />
<folding>
<element signature="e#39#59#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="172" column="28" selection-start-line="172" selection-start-column="28" selection-end-line="172" selection-end-column="28" />
<folding>
<element signature="e#47#67#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="304">
<caret line="19" column="38" selection-start-line="19" selection-start-column="38" selection-end-line="19" selection-end-column="38" />
<folding>
<element signature="e#0#46#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="83" column="22" lean-forward="true" selection-start-line="83" selection-start-column="22" selection-end-line="83" selection-end-column="44" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/metadata.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152">
<caret line="93" column="65" selection-start-line="93" selection-start-column="65" selection-end-line="93" selection-end-column="65" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View file

@ -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.
replaced with `parseBody`, `parseUploadedFiles`, and `parseRawRequestBuffer`, respectively.
* Removed the synchronous equivalents of the above methods (`body`, `files`, and `originalBuffer`).

View file

@ -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;
}
}

View file

@ -59,70 +59,15 @@ abstract class RequestContext<RawRequest> {
/// 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<FileUploadInfo> 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<int> 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<RawRequest> {
/// 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<Map<String, dynamic>> lazyQuery({bool forceParse: false}) {
Future<Map<String, dynamic>> parseQuery({bool forceParse: false}) {
if (_body == null && forceParse != true)
return new Future.value(uri.queryParameters);
else

View file

@ -160,11 +160,13 @@ class Service extends Routable {
Middleware indexMiddleware = getAnnotation(service.index, Middleware);
get('/', (RequestContext req, res) {
return this.index(mergeMap([
{'query': req.query},
restProvider,
req.serviceParams
]));
return req.parseQuery().then((query) {
return this.index(mergeMap([
{'query': query},
restProvider,
req.serviceParams
]));
});
},
middleware: []
..addAll(handlers)
@ -172,18 +174,20 @@ class Service extends Routable {
Middleware createMiddleware = getAnnotation(service.create, Middleware);
post('/', (RequestContext req, ResponseContext res) {
return req.parseBody().then((body) {
return this
.create(
body,
mergeMap([
{'query': req.query},
restProvider,
req.serviceParams
]))
.then((r) {
res.statusCode = 201;
return r;
return req.parseQuery().then((query) {
return req.parseBody().then((body) {
return this
.create(
body,
mergeMap([
{'query': query},
restProvider,
req.serviceParams
]))
.then((r) {
res.statusCode = 201;
return r;
});
});
});
},
@ -194,15 +198,17 @@ class Service extends Routable {
Middleware readMiddleware = getAnnotation(service.read, Middleware);
get(
'/:id',
(RequestContext req, res) => this.read(
get('/:id', (RequestContext req, res) {
return req.parseQuery().then((query) {
return this.read(
parseId(req.params['id']),
mergeMap([
{'query': req.query},
{'query': query},
restProvider,
req.serviceParams
])),
]));
});
},
middleware: []
..addAll(handlers)
..addAll((readMiddleware == null) ? [] : readMiddleware.handlers));
@ -210,14 +216,18 @@ class Service extends Routable {
Middleware modifyMiddleware = getAnnotation(service.modify, Middleware);
patch(
'/:id',
(RequestContext req, res) => req.parseBody().then((body) => this.modify(
parseId(req.params['id']),
body,
mergeMap([
{'query': req.query},
restProvider,
req.serviceParams
]))),
(RequestContext req, res) => req.parseBody().then((body) {
return req.parseQuery().then((query) {
return this.modify(
parseId(req.params['id']),
body,
mergeMap([
{'query': query},
restProvider,
req.serviceParams
]));
});
}),
middleware: []
..addAll(handlers)
..addAll(
@ -226,56 +236,68 @@ class Service extends Routable {
Middleware updateMiddleware = getAnnotation(service.update, Middleware);
post(
'/:id',
(RequestContext req, res) => req.parseBody().then((body) => this.update(
parseId(req.params['id']),
body,
mergeMap([
{'query': req.query},
restProvider,
req.serviceParams
]))),
(RequestContext req, res) => req.parseBody().then((body) {
return req.parseQuery().then((query) {
return this.update(
parseId(req.params['id']),
body,
mergeMap([
{'query': query},
restProvider,
req.serviceParams
]));
});
}),
middleware: []
..addAll(handlers)
..addAll(
(updateMiddleware == null) ? [] : updateMiddleware.handlers));
put(
'/:id',
(RequestContext req, res) => req.parseBody().then((body) => this.update(
parseId(req.params['id']),
body,
mergeMap([
{'query': req.query},
restProvider,
req.serviceParams
]))),
(RequestContext req, res) => req.parseBody().then((body) {
return req.parseQuery().then((query) {
return this.update(
parseId(req.params['id']),
body,
mergeMap([
{'query': query},
restProvider,
req.serviceParams
]));
});
}),
middleware: []
..addAll(handlers)
..addAll(
(updateMiddleware == null) ? [] : updateMiddleware.handlers));
Middleware removeMiddleware = getAnnotation(service.remove, Middleware);
delete(
'/',
(RequestContext req, res) => this.remove(
delete('/', (RequestContext req, res) {
return req.parseQuery().then((query) {
return this.remove(
null,
mergeMap([
{'query': req.query},
{'query': query},
restProvider,
req.serviceParams
])),
]));
});
},
middleware: []
..addAll(handlers)
..addAll(
(removeMiddleware == null) ? [] : removeMiddleware.handlers));
delete(
'/:id',
(RequestContext req, res) => this.remove(
delete('/:id', (RequestContext req, res) {
return req.parseQuery().then((query) {
return this.remove(
parseId(req.params['id']),
mergeMap([
{'query': req.query},
{'query': query},
restProvider,
req.serviceParams
])),
]));
});
},
middleware: []
..addAll(handlers)
..addAll(

View file

@ -81,7 +81,7 @@ main() {
res.redirectTo('Named routes', {'name': 'tests'});
});
app.get('/log', (RequestContext req, res) async {
print("Query: ${req.query}");
print("Query: ${await req.parseQuery()}");
return "Logged";
});