mastercontroller 1.3.30 → 1.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MasterControl.js +3 -0
- package/MasterRouter.js +1 -1
- package/package.json +1 -1
package/MasterControl.js
CHANGED
|
@@ -959,6 +959,9 @@ class MasterControl {
|
|
|
959
959
|
|
|
960
960
|
// 5. Routing (TERMINAL - always needed)
|
|
961
961
|
$that.pipeline.run(async (ctx) => {
|
|
962
|
+
// Attach pipeline state to raw request object so it survives even if
|
|
963
|
+
// config/load creates a new requestObject without copying ctx.state
|
|
964
|
+
ctx.request.__pipelineState = ctx.state;
|
|
962
965
|
// Load config/load which triggers routing
|
|
963
966
|
require(`${$that.root}/config/load`)(ctx);
|
|
964
967
|
});
|
package/MasterRouter.js
CHANGED
|
@@ -816,7 +816,7 @@ class MasterRouter {
|
|
|
816
816
|
control.__currentRoute = currentRoute;
|
|
817
817
|
control.__response = requestObject.response;
|
|
818
818
|
control.__request = requestObject.request;
|
|
819
|
-
control.state = requestObject.state || {};
|
|
819
|
+
control.state = requestObject.state || requestObject.request.__pipelineState || {};
|
|
820
820
|
const _callEmit = new EventEmitter();
|
|
821
821
|
|
|
822
822
|
_callEmit.once(EVENT_NAMES.CONTROLLER, function(){
|
package/package.json
CHANGED