fix: use proper middleware for Anti-Crawler header to avoid TypeError

This commit is contained in:
dyzulk
2026-01-01 17:58:13 +07:00
parent 025286101e
commit d36b36dbcf
2 changed files with 25 additions and 6 deletions

View File

@@ -19,12 +19,7 @@ return Application::configure(basePath: dirname(__DIR__))
'admin' => \App\Http\Middleware\AdminMiddleware::class,
]);
// Anti-crawler header
$middleware->append(function ($request, $next) {
$response = $next($request);
$response->headers->set('X-Robots-Tag', 'noindex, nofollow, noarchive');
return $response;
});
$middleware->append(\App\Http\Middleware\AntiCrawlerMiddleware::class);
})
->withExceptions(function (Exceptions $exceptions): void {
//