public static CorsHandler newInstance(io.vertx.ext.web.handler.CorsHandler arg) { return arg != null ? new CorsHandler(arg) : null; } }
protected void enableCorsSupport(Router router) { Set<String> allowHeaders = new HashSet<>(); allowHeaders.add("x-requested-with"); allowHeaders.add("Access-Control-Allow-Origin"); allowHeaders.add("origin"); allowHeaders.add("Content-Type"); allowHeaders.add("accept"); router.route().handler(CorsHandler.create("*") .allowedHeaders(allowHeaders) .allowedMethod(HttpMethod.GET) .allowedMethod(HttpMethod.POST) .allowedMethod(HttpMethod.PUT) .allowedMethod(HttpMethod.DELETE) .allowedMethod(HttpMethod.PATCH) .allowedMethod(HttpMethod.OPTIONS) ); }
/** * Create a CORS handler * @param allowedOriginPattern the allowed origin pattern * @return the handler */ public static io.vertx.rxjava.ext.web.handler.CorsHandler create(String allowedOriginPattern) { io.vertx.rxjava.ext.web.handler.CorsHandler ret = io.vertx.rxjava.ext.web.handler.CorsHandler.newInstance(io.vertx.ext.web.handler.CorsHandler.create(allowedOriginPattern)); return ret; }
/** * Create a CORS handler * @param allowedOriginPattern the allowed origin pattern * @return the handler */ public static io.vertx.rxjava.ext.web.handler.CorsHandler create(String allowedOriginPattern) { io.vertx.rxjava.ext.web.handler.CorsHandler ret = io.vertx.rxjava.ext.web.handler.CorsHandler.newInstance(io.vertx.ext.web.handler.CorsHandler.create(allowedOriginPattern)); return ret; }
public static CorsHandler newInstance(io.vertx.ext.web.handler.CorsHandler arg) { return arg != null ? new CorsHandler(arg) : null; } }