最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How can we block access to a website from HTTPS clients like Postman and cURL? - Stack Overflow

programmeradmin3浏览0评论

We are using Laravel and trying to update the Cors.php middleware, but it's not working.

Here is the Cors.php code

    public function handle($request, Closure $next)
    {
       if (null !== $request->server->get('HTTP_POSTMAN_TOKEN')) {
          abort(404);
      }

      return $next($request)
        ->header('Access-Control-Allow-Origin', '/')
        ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS')
        ->header('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, X-Token-Auth, Authorization');
    }
发布评论

评论列表(0)

  1. 暂无评论