File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -929,6 +929,7 @@ Request Config Options
929929 'server_vars' => [],
930930 'allowed_hosts' => [],
931931 'force_https' => false,
932+ 'json_flags' => null,
932933 ],
933934 ],
934935 ]
@@ -949,6 +950,11 @@ force_https
949950Set ``true `` to automatically redirect to the HTTPS version of the current URL.
950951By default it is not set.
951952
953+ json_flags
954+ """"""""""
955+
956+ Flags for ``json_decode ``. The default is set to none.
957+
952958Response Service
953959^^^^^^^^^^^^^^^^
954960
@@ -974,6 +980,7 @@ Response Config Options
974980 'cache' => null,
975981 'csp' => [],
976982 'csp_report_only' => [],
983+ 'json_flags' => null,
977984 'request_instance' => 'default',
978985 ],
979986 ],
@@ -1028,6 +1035,11 @@ It can take an array of directives to initialize an instance of
10281035``Framework\HTTP\CSP `` and pass it as the **Content-Security-Policy-Report-Only **
10291036of the response.
10301037
1038+ json_flags
1039+ """"""""""
1040+
1041+ Flags for ``json_encode ``. The default is set to none.
1042+
10311043request_instance
10321044""""""""""""""""
10331045
Original file line number Diff line number Diff line change @@ -1122,6 +1122,9 @@ protected static function setRequest(string $instance) : Request
11221122 if (isset ($ config ['force_https ' ]) && $ config ['force_https ' ] === true ) {
11231123 $ service ->forceHttps ();
11241124 }
1125+ if (isset ($ config ['json_flags ' ])) {
1126+ $ service ->setJsonFlags ($ config ['json_flags ' ]);
1127+ }
11251128 return static ::setService ('request ' , $ service , $ instance );
11261129 }
11271130
@@ -1191,6 +1194,9 @@ protected static function setResponse(string $instance) : Response
11911194 if (!empty ($ config ['csp_report_only ' ])) {
11921195 $ service ->setCspReportOnly (new CSP ($ config ['csp_report_only ' ]));
11931196 }
1197+ if (isset ($ config ['json_flags ' ])) {
1198+ $ service ->setJsonFlags ($ config ['json_flags ' ]);
1199+ }
11941200 return static ::setService ('response ' , $ service , $ instance );
11951201 }
11961202
Original file line number Diff line number Diff line change 1414 'server_vars ' => [
1515 'HTTP_FOO ' => 'Foo ' ,
1616 ],
17+ 'json_flags ' => \JSON_THROW_ON_ERROR ,
1718 ],
1819];
Original file line number Diff line number Diff line change 3838 'self ' ,
3939 ],
4040 ],
41+ 'json_flags ' => \JSON_THROW_ON_ERROR ,
4142 'request_instance ' => 'default ' ,
4243 ],
4344];
You can’t perform that action at this time.
0 commit comments