You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2021/04/21 19:33:00 UTC

[airavata-mft] branch develop updated: Add CorsHandler for downloading from Django portal

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-mft.git


The following commit(s) were added to refs/heads/develop by this push:
     new 0fcc130  Add CorsHandler for downloading from Django portal
0fcc130 is described below

commit 0fcc1308b584791a6f5bbc6f115bd0d56b4a98ff
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Apr 15 17:00:43 2021 -0400

    Add CorsHandler for downloading from Django portal
---
 .../java/org/apache/airavata/mft/agent/http/HttpServerInitializer.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/agent/src/main/java/org/apache/airavata/mft/agent/http/HttpServerInitializer.java b/agent/src/main/java/org/apache/airavata/mft/agent/http/HttpServerInitializer.java
index f94d067..12484c9 100644
--- a/agent/src/main/java/org/apache/airavata/mft/agent/http/HttpServerInitializer.java
+++ b/agent/src/main/java/org/apache/airavata/mft/agent/http/HttpServerInitializer.java
@@ -22,6 +22,8 @@ import io.netty.channel.ChannelPipeline;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.handler.codec.http.HttpObjectAggregator;
 import io.netty.handler.codec.http.HttpServerCodec;
+import io.netty.handler.codec.http.cors.CorsConfigBuilder;
+import io.netty.handler.codec.http.cors.CorsHandler;
 import io.netty.handler.ssl.SslContext;
 import io.netty.handler.stream.ChunkedWriteHandler;
 
@@ -44,6 +46,7 @@ public class HttpServerInitializer extends ChannelInitializer<SocketChannel> {
         pipeline.addLast(new HttpServerCodec());
         pipeline.addLast(new HttpObjectAggregator(65536));
         pipeline.addLast(new ChunkedWriteHandler());
+        pipeline.addLast(new CorsHandler(CorsConfigBuilder.forAnyOrigin().build()));
         pipeline.addLast(new HttpServerHandler(transferRequestsStore));
     }
 }