Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function process(ServerRequestInterface $request, DelegateInterface $delegate) |
||
26 | { |
||
27 | $headers = $request->getHeader('content-type'); |
||
28 | foreach ($headers as $header) { |
||
29 | if ('application/x-www-form-urlencoded' === substr($header, 0, 33)) { |
||
30 | $request->getBody()->rewind(); |
||
31 | $body = $request->getBody()->getContents(); |
||
32 | if (true === parse_str($body, $parsed)) { |
||
33 | $request = $request->withParsedBody($parsed); |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | |||
38 | return $delegate->process($request); |
||
39 | } |
||
40 | } |
||
41 |