File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ protected function executeWithMiddleware(
255255 $ contentType = $ request ->getHeaderLine ('Content-Type ' );
256256 if (str_contains ($ contentType , 'application/json ' )) {
257257 $ decoded = json_decode ($ bodyContents , true );
258- if ($ decoded !== null ) {
258+ if (json_last_error () === JSON_ERROR_NONE ) {
259259 $ options ['json ' ] = $ decoded ;
260260 unset($ options ['body ' ]);
261261 } else {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ interface MiddlewareInterface
2020 *
2121 * @param RequestInterface $request The HTTP request to process
2222 * @param callable $next The next middleware or final handler
23- * @return Response|PromiseInterface<Response> The response or promise
23+ * @return \Fetch\Interfaces\ Response|PromiseInterface<\Fetch\Interfaces\ Response> The response or promise
2424 */
2525 public function handle (RequestInterface $ request , callable $ next ): Response |PromiseInterface ;
2626}
You can’t perform that action at this time.
0 commit comments