@@ -17,70 +17,70 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class SessionCheck implements EnvironmentCheck |
| 19 | 19 | { |
| 20 | - use Configurable; |
|
| 21 | - use Fetcher; |
|
| 20 | + use Configurable; |
|
| 21 | + use Fetcher; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * URL to check |
|
| 25 | - * |
|
| 26 | - * @var string |
|
| 27 | - */ |
|
| 28 | - protected $url; |
|
| 23 | + /** |
|
| 24 | + * URL to check |
|
| 25 | + * |
|
| 26 | + * @var string |
|
| 27 | + */ |
|
| 28 | + protected $url; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Set up check with URL |
|
| 32 | - * |
|
| 33 | - * @param string $url The route, excluding the domain |
|
| 34 | - * @inheritdoc |
|
| 35 | - */ |
|
| 36 | - public function __construct($url = '') |
|
| 37 | - { |
|
| 38 | - $this->url = $url; |
|
| 39 | - $this->clientConfig = [ |
|
| 40 | - 'base_uri' => Director::absoluteBaseURL(), |
|
| 41 | - 'timeout' => 10.0, |
|
| 42 | - ]; |
|
| 43 | - } |
|
| 30 | + /** |
|
| 31 | + * Set up check with URL |
|
| 32 | + * |
|
| 33 | + * @param string $url The route, excluding the domain |
|
| 34 | + * @inheritdoc |
|
| 35 | + */ |
|
| 36 | + public function __construct($url = '') |
|
| 37 | + { |
|
| 38 | + $this->url = $url; |
|
| 39 | + $this->clientConfig = [ |
|
| 40 | + 'base_uri' => Director::absoluteBaseURL(), |
|
| 41 | + 'timeout' => 10.0, |
|
| 42 | + ]; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Check that the response for URL does not create a session |
|
| 47 | - * |
|
| 48 | - * @return array |
|
| 49 | - */ |
|
| 50 | - public function check() |
|
| 51 | - { |
|
| 52 | - $response = $this->fetchResponse($this->url); |
|
| 53 | - $cookie = $this->getCookie($response); |
|
| 54 | - $fullURL = Controller::join_links(Director::absoluteBaseURL(), $this->url); |
|
| 45 | + /** |
|
| 46 | + * Check that the response for URL does not create a session |
|
| 47 | + * |
|
| 48 | + * @return array |
|
| 49 | + */ |
|
| 50 | + public function check() |
|
| 51 | + { |
|
| 52 | + $response = $this->fetchResponse($this->url); |
|
| 53 | + $cookie = $this->getCookie($response); |
|
| 54 | + $fullURL = Controller::join_links(Director::absoluteBaseURL(), $this->url); |
|
| 55 | 55 | |
| 56 | - if ($cookie) { |
|
| 57 | - return [ |
|
| 58 | - EnvironmentCheck::ERROR, |
|
| 59 | - "Sessions are being set for {$fullURL} : Set-Cookie => " . $cookie, |
|
| 60 | - ]; |
|
| 61 | - } |
|
| 62 | - return [ |
|
| 63 | - EnvironmentCheck::OK, |
|
| 64 | - "Sessions are not being created for {$fullURL} |
|