mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 13:22:05 +07:00
fix: use proper middleware for Anti-Crawler header to avoid TypeError
This commit is contained in:
@@ -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 {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user