@@ -27,10 +27,10 @@ |
||
27 | 27 | */ |
28 | 28 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
29 | 29 | { |
30 | - if ($this->isJsonPayload($request)) { |
|
31 | - try { |
|
30 | + if ($this->isJsonPayload($request)){ |
|
31 | + try{ |
|
32 | 32 | $request = $request->withParsedBody(json_decode($request->getBody()->getContents(), true)); |
33 | - } catch (\Throwable $exception) { |
|
33 | + }catch (\Throwable $exception){ |
|
34 | 34 | throw new ClientException(400, 'invalid json payload'); |
35 | 35 | } |
36 | 36 | } |
@@ -27,10 +27,14 @@ |
||
27 | 27 | */ |
28 | 28 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
29 | 29 | { |
30 | - if ($this->isJsonPayload($request)) { |
|
31 | - try { |
|
30 | + if ($this->isJsonPayload($request)) |
|
31 | + { |
|
32 | + try |
|
33 | + { |
|
32 | 34 | $request = $request->withParsedBody(json_decode($request->getBody()->getContents(), true)); |
33 | - } catch (\Throwable $exception) { |
|
35 | + } |
|
36 | + catch (\Throwable $exception) |
|
37 | + { |
|
34 | 38 | throw new ClientException(400, 'invalid json payload'); |
35 | 39 | } |
36 | 40 | } |