提交 7d2394d4 编写于 作者: U Ufuk Celebi

[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
上级 61cff8e3
......@@ -119,6 +119,7 @@ public class RuntimeMonitorHandler extends SimpleChannelInboundHandler<Routed> {
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册