Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
24 | public function process( |
||
25 | ServerRequestInterface $request, |
||
26 | RequestHandlerInterface $handler): ResponseInterface |
||
27 | { |
||
28 | if ('https' !== $request->getUri()->getScheme()) { |
||
29 | return (new ServerResponse(null, HttpStatus::MOVED_PERMANENTLY)) |
||
30 | ->withHeader('Location', (string)$request->getUri()->withScheme('https')); |
||
31 | } |
||
32 | return $handler->handle($request)->withHeader( |
||
|
|||
33 | 'Strict-Transport-Security', 'max-age=' . $this->maxAge . $this->includeSubDomains |
||
34 | ); |
||
37 |