@Test void shouldDelegate() throws Exception { corsHandler.handleRequest(dummyExchange); assertTrue(testHandler.hasCalled()); }
@Override public void handleRequest(HttpServerExchange exchange) throws Exception { HeaderMap responseHeaders = exchange.getResponseHeaders(); responseHeaders.add(HttpString.tryFromString("Access-Control-Allow-Origin"), "*"); handler.handleRequest(exchange); }
CorsHandler implements HttpHandler { @Override public void handleRequest(HttpServerExchange exchange) throws Exception { HeaderMap responseHeaders = exchange.getResponseHeaders(); responseHeaders.add(HttpString.tryFromString("Access-Control-Allow-Origin"), "*"); handler.handleRequest(exchange); } }
CorsHandler implements HttpHandler { @Override public void handleRequest(HttpServerExchange exchange) throws Exception { HeaderMap responseHeaders = exchange.getResponseHeaders(); responseHeaders.add(HttpString.tryFromString("Access-Control-Allow-Origin"), "*"); handler.handleRequest(exchange); } CorsHandler(HttpHandler handler); }
CorsHandler implements HttpHandler { @Override public void handleRequest(HttpServerExchange exchange) throws Exception { HeaderMap responseHeaders = exchange.getResponseHeaders(); responseHeaders.add(HttpString.tryFromString("Access-Control-Allow-Origin"), "*"); handler.handleRequest(exchange); } CorsHandler(HttpHandler handler); @Override void handleRequest(HttpServerExchange exchange); }
CorsHandler implements HttpHandler { @Override public void handleRequest(HttpServerExchange exchange) throws Exception { HeaderMap responseHeaders = exchange.getResponseHeaders(); responseHeaders.add(HttpString.tryFromString("Access-Control-Allow-Origin"), "*"); handler.handleRequest(exchange); } CorsHandler(HttpHandler handler); @Override void handleRequest(HttpServerExchange exchange);  }