| 1 | <?php |
||
| 21 | class Secure implements RuleInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * |
||
| 25 | * Checks that the Route `$secure` matches the corresponding server values. |
||
| 26 | * |
||
| 27 | * @param ServerRequestInterface $request The HTTP request. |
||
| 28 | * |
||
| 29 | * @param Route $route The route. |
||
| 30 | * |
||
| 31 | * @return bool True on success, false on failure. |
||
| 32 | * |
||
| 33 | */ |
||
| 34 | 7 | public function __invoke(ServerRequestInterface $request, Route $route) |
|
| 44 | |||
| 45 | /** |
||
| 46 | * |
||
| 47 | * Is HTTPS on? |
||
| 48 | * |
||
| 49 | * @param array $server The server params. |
||
| 50 | * |
||
| 51 | * @return bool |
||
| 52 | * |
||
| 53 | */ |
||
| 54 | 2 | protected function https($server) |
|
| 59 | |||
| 60 | |||
| 61 | /** |
||
| 62 | * |
||
| 63 | * Is the request on port 443? |
||
| 64 | * |
||
| 65 | * @param array $server The server params. |
||
| 66 | * |
||
| 67 | * @return bool |
||
| 68 | * |
||
| 69 | */ |
||
| 70 | 2 | protected function port443($server) |
|
| 75 | } |
||
| 76 |