Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function handle($request, Closure $next) |
||
19 | { |
||
20 | $allowedHosts = config('domain-checker.allowed_domains'); |
||
21 | $requestHost = $request->getHost(); |
||
22 | |||
23 | if (!app()->runningUnitTests()) { |
||
24 | if (!\in_array($requestHost, $allowedHosts, false)) { |
||
25 | $requestInfo = [ |
||
26 | 'host' => $requestHost, |
||
27 | 'ip' => $request->getClientIp(), |
||
28 | 'url' => $request->getRequestUri(), |
||
29 | 'agent' => $request->header('User-Agent'), |
||
30 | ]; |
||
31 | $error_msg=config('domain-checker.error_message'); |
||
32 | Log::alert('------------------------------------------Domaine Checker------------------------------------------'); |
||
33 | Log::alert('access_from_unauthorized_domain'); |
||
34 | Log::alert($requestInfo); |
||
35 | Log::alert('---------------------------------------------------------------------------------------------------'); |
||
36 | throw new AccessDeniedHttpException($error_msg); |
||
37 | } |
||
38 | } |
||
39 | return $next($request); |
||
40 | } |
||
42 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths