@@ -16,25 +16,25 @@ |
||
16 | 16 | */ |
17 | 17 | class BotDetector extends Middleware |
18 | 18 | { |
19 | - /** |
|
20 | - * converts a Request to a Response |
|
21 | - * |
|
22 | - * @param RequestInterface $request |
|
23 | - * @param ResponseInterface $response |
|
24 | - * @return ResponseInterface |
|
25 | - */ |
|
26 | - public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
27 | - { |
|
28 | - $this->request = $request; |
|
29 | - $this->response = $response; |
|
30 | - /** @var CrawlerDetect $CrawlerDetect */ |
|
31 | - $CrawlerDetect = $this->loader->getShared('EventEspressoVendor\CrawlerDetect\CrawlerDetect'); |
|
32 | - if ($CrawlerDetect instanceof CrawlerDetect) { |
|
33 | - // Check and record the user agent of the current 'visitor' |
|
34 | - $this->request->setIsBot($CrawlerDetect->isCrawler()); |
|
35 | - $this->request->setUserAgent($CrawlerDetect->userAgent()); |
|
36 | - } |
|
37 | - $this->response = $this->processRequestStack($this->request, $this->response); |
|
38 | - return $this->response; |
|
39 | - } |
|
19 | + /** |
|
20 | + * converts a Request to a Response |
|
21 | + * |
|
22 | + * @param RequestInterface $request |
|
23 | + * @param ResponseInterface $response |
|
24 | + * @return ResponseInterface |
|
25 | + */ |
|
26 | + public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
27 | + { |
|
28 | + $this->request = $request; |
|
29 | + $this->response = $response; |
|
30 | + /** @var CrawlerDetect $CrawlerDetect */ |
|
31 | + $CrawlerDetect = $this->loader->getShared('EventEspressoVendor\CrawlerDetect\CrawlerDetect'); |
|
32 | + if ($CrawlerDetect instanceof CrawlerDetect) { |
|
33 | + // Check and record the user agent of the current 'visitor' |
|
34 | + $this->request->setIsBot($CrawlerDetect->isCrawler()); |
|
35 | + $this->request->setUserAgent($CrawlerDetect->userAgent()); |
|
36 | + } |
|
37 | + $this->response = $this->processRequestStack($this->request, $this->response); |
|
38 | + return $this->response; |
|
39 | + } |
|
40 | 40 | } |