Skip to content

Commit 9c68477

Browse files
committed
Changed validation exception to abort.
1 parent 46ae82d commit 9c68477

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Middlewares/BlockExternalTraffic.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Closure;
66
use Illuminate\Http\Request;
7-
use Illuminate\Validation\ValidationException;
87

98
class BlockExternalTraffic
109
{
@@ -14,7 +13,7 @@ public function handle(Request $request, Closure $next)
1413
$domain = config('strict-domain.domain');
1514

1615
if ($request->getHttpHost() !== $domain) {
17-
throw ValidationException::withMessages([sprintf('Traffic outside %s host is not allowed.', $domain)]);
16+
abort(400, sprintf('Traffic outside %s host is not allowed.', $domain));
1817
}
1918

2019
return $response;

0 commit comments

Comments
 (0)