We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ebf1ab0 + 462e717 commit da0932cCopy full SHA for da0932c
JsonRpcRequest.php
@@ -14,6 +14,7 @@
14
use yii\web\Application;
15
use yii\web\BadRequestHttpException;
16
use yii\web\NotFoundHttpException;
17
+use yii\web\Response;
18
19
/**
20
* Class JsonRpcRequest
@@ -193,6 +194,16 @@ public function execute()
193
194
} catch (\Exception $e) {
195
throw new InternalErrorException('Internal error', [], $e);
196
}
197
+
198
+ if (is_null($result)) {
199
+ // in case we don't have any response (e.g. notification request)
200
+ // we should return nothing
201
+ // without this fix json response formatter will return 'null'
202
+ \Yii::$app->response->format = Response::FORMAT_RAW;
203
+ \Yii::$app->response->data = null;
204
+ \Yii::$app->end();
205
+ }
206
207
return $result;
208
209
0 commit comments