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

[airavata-mft] branch corshandler created (now 89d9758)

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

machristie pushed a change to branch corshandler
in repository https://gitbox.apache.org/repos/asf/airavata-mft.git.


      at 89d9758  Add CorsHandler for downloading from Django portal

This branch includes the following new commits:

     new 89d9758  Add CorsHandler for downloading from Django portal

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[airavata-mft] 01/01: Add CorsHandler for downloading from Django portal

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 89d97586587ac9b47207dfbbaa3c246967320d3a
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));
     }
 }