@@ -28,14 +28,20 @@ public function __construct(array $config, RouterInterface $router)
2828 $ this ->router = $ router ;
2929 }
3030
31- private function setHttpStrictTransportSecurity ($ uriScheme , RouteResult $ match , ResponseInterface $ response ) : ResponseInterface
32- {
33- if ($ this ->isSkippedHttpStrictTransportSecurity ($ uriScheme , $ match , $ response )) {
31+ private function setHttpStrictTransportSecurity (
32+ string $ uriScheme ,
33+ ResponseInterface $ response ,
34+ RouteResult $ match
35+ ) : ResponseInterface {
36+ if ($ this ->isSkippedHttpStrictTransportSecurity ($ uriScheme , $ match )) {
3437 return $ response ;
3538 }
3639
3740 if ($ this ->config ['strict_transport_security ' ]['enable ' ] === true ) {
38- return $ response ->withHeader ('Strict-Transport-Security ' , $ this ->config ['strict_transport_security ' ]['value ' ]);
41+ return $ response ->withHeader (
42+ 'Strict-Transport-Security ' ,
43+ $ this ->config ['strict_transport_security ' ]['value ' ]
44+ );
3945 }
4046
4147 return $ response ->withHeader ('Strict-Transport-Security ' , 'max-age=0 ' );
@@ -53,7 +59,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
5359 $ uri = $ request ->getUri ();
5460 $ uriScheme = $ uri ->getScheme ();
5561
56- $ response = $ this ->setHttpStrictTransportSecurity ($ uriScheme , $ match , $ response );
62+ $ response = $ this ->setHttpStrictTransportSecurity ($ uriScheme , $ response , $ match );
5763 if (! $ this ->isGoingToBeForcedToHttps ($ match )) {
5864 return $ response ;
5965 }
0 commit comments