From 7d2394d4ee63adf39a53ffd57b7c06cc67e21d96 Mon Sep 17 00:00:00 2001 From: Ufuk Celebi Date: Wed, 9 Dec 2015 16:36:35 +0100 Subject: [PATCH] [FLINK-2769] [runtime-web] Set allow-origin header Many browsers don't allow cross-origin HTTP requests if the respective HTTP header is not set by the server. Because of this it was not possible to test changes to the web frontend with the local proxy server and a running job manager. See here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS --- .../apache/flink/runtime/webmonitor/RuntimeMonitorHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/RuntimeMonitorHandler.java b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/RuntimeMonitorHandler.java index e174463b874..e5815c7cf18 100644 --- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/RuntimeMonitorHandler.java +++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/RuntimeMonitorHandler.java @@ -119,6 +119,7 @@ public class RuntimeMonitorHandler extends SimpleChannelInboundHandler { response = new DefaultFullHttpResponse( HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.wrappedBuffer(bytes)); + response.headers().set(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN, "*"); response.headers().set(HttpHeaders.Names.CONTENT_TYPE, contentType); } catch (NotFoundException e) { -- GitLab