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
929
929
'server_vars' => [],
930
930
'allowed_hosts' => [],
931
931
'force_https' => false,
932
+ 'json_flags' => null,
932
933
],
933
934
],
934
935
]
@@ -949,6 +950,11 @@ force_https
949
950
Set ``true `` to automatically redirect to the HTTPS version of the current URL.
950
951
By default it is not set.
951
952
953
+ json_flags
954
+ """"""""""
955
+
956
+ Flags for ``json_decode ``. The default is set to none.
957
+
952
958
Response Service
953
959
^^^^^^^^^^^^^^^^
954
960
@@ -974,6 +980,7 @@ Response Config Options
974
980
'cache' => null,
975
981
'csp' => [],
976
982
'csp_report_only' => [],
983
+ 'json_flags' => null,
977
984
'request_instance' => 'default',
978
985
],
979
986
],
@@ -1028,6 +1035,11 @@ It can take an array of directives to initialize an instance of
1028
1035
``Framework\HTTP\CSP `` and pass it as the **Content-Security-Policy-Report-Only **
1029
1036
of the response.
1030
1037
1038
+ json_flags
1039
+ """"""""""
1040
+
1041
+ Flags for ``json_encode ``. The default is set to none.
1042
+
1031
1043
request_instance
1032
1044
""""""""""""""""
1033
1045
Original file line number Diff line number Diff line change @@ -1122,6 +1122,9 @@ protected static function setRequest(string $instance) : Request
1122
1122
if (isset ($ config ['force_https ' ]) && $ config ['force_https ' ] === true ) {
1123
1123
$ service ->forceHttps ();
1124
1124
}
1125
+ if (isset ($ config ['json_flags ' ])) {
1126
+ $ service ->setJsonFlags ($ config ['json_flags ' ]);
1127
+ }
1125
1128
return static ::setService ('request ' , $ service , $ instance );
1126
1129
}
1127
1130
@@ -1191,6 +1194,9 @@ protected static function setResponse(string $instance) : Response
1191
1194
if (!empty ($ config ['csp_report_only ' ])) {
1192
1195
$ service ->setCspReportOnly (new CSP ($ config ['csp_report_only ' ]));
1193
1196
}
1197
+ if (isset ($ config ['json_flags ' ])) {
1198
+ $ service ->setJsonFlags ($ config ['json_flags ' ]);
1199
+ }
1194
1200
return static ::setService ('response ' , $ service , $ instance );
1195
1201
}
1196
1202
Original file line number Diff line number Diff line change 14
14
'server_vars ' => [
15
15
'HTTP_FOO ' => 'Foo ' ,
16
16
],
17
+ 'json_flags ' => \JSON_THROW_ON_ERROR ,
17
18
],
18
19
];
Original file line number Diff line number Diff line change 38
38
'self ' ,
39
39
],
40
40
],
41
+ 'json_flags ' => \JSON_THROW_ON_ERROR ,
41
42
'request_instance ' => 'default ' ,
42
43
],
43
44
];
You can’t perform that action at this time.
0 commit comments