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

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

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');
    }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744806476a4594806.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信