cors处理

跨源资源共享是允许从一个域请求资源并从另一个域进行服务的安全机制。

Vert.x-Web包含一个CorsHandler为您处理CORS协议的处理程序

这是一个例子:

router.route().handler(CorsHandler.create("vertx\\.io").allowedMethod(HttpMethod.GET));

router.route().handler(routingContext -> {

  // Your app handlers

});

猜你喜欢

转载自blog.csdn.net/zyydecsdn/article/details/80281189
今日推荐