You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Action.php
+66-9Lines changed: 66 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,8 @@
5
5
useyii\base\InvalidRouteException;
6
6
useyii\base\UserException;
7
7
useyii\helpers\Json;
8
+
useyii\web\NotFoundHttpException;
9
+
useyii\web\Request;
8
10
9
11
/**
10
12
* Class Action
@@ -17,6 +19,11 @@
17
19
*/
18
20
class Action extends \yii\base\Action {
19
21
22
+
/** @var Request $originalYiiRequest */
23
+
private$originalYiiRequest;
24
+
25
+
public$paramsPassMethod;
26
+
20
27
/**
21
28
* Parses json body.
22
29
* @param $rawBody
@@ -39,7 +46,8 @@ public function parseJsonRpcBody($rawBody) {
39
46
40
47
41
48
/**
42
-
* Validates method string and converts it into a route.
49
+
* Validates method string and converts it into a route, which is going to be parsed by UrlManager before executing
50
+
* the request.
43
51
* @param $method
44
52
* @return bool|string
45
53
*/
@@ -80,7 +88,7 @@ public function parseRequest($request) {
80
88
thrownewJsonRpcException($request->id, "The JSON sent is not a correct JSON-RPC request - missing or incorrect method.", JSON_RPC_ERROR_REQUEST_INVALID);
81
89
}
82
90
83
-
$params = null;
91
+
$params = [];
84
92
if (isset($request->params)) {
85
93
$params = (array) $request->params;
86
94
}
@@ -121,30 +129,79 @@ public function parseRequests($params) {
121
129
thrownewJsonRpcException(null, "The JSON sent is not a correct JSON-RPC request.", JSON_RPC_ERROR_REQUEST_INVALID);
0 commit comments