From 182063b69788c6878ccd3a294467a45a8740e758 Mon Sep 17 00:00:00 2001 From: Lars Gierth Date: Tue, 25 Aug 2015 00:27:20 +0200 Subject: [PATCH] ipfs: enable CORS for API License: MIT Signed-off-by: Lars Gierth --- solarnet/roles/ipfs/templates/config.j2 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/solarnet/roles/ipfs/templates/config.j2 b/solarnet/roles/ipfs/templates/config.j2 index f48f050..9f1839e 100644 --- a/solarnet/roles/ipfs/templates/config.j2 +++ b/solarnet/roles/ipfs/templates/config.j2 @@ -48,7 +48,29 @@ }, "Gateway": { "RootRedirect": "", - "Writable": false + "Writable": false, + "HTTPHeaders": { + "Access-Control-Allow-Origin": [ + "http://gateway.ipfs.io", + "http://ipfs.io", + "http://localhost", + "http://localhost:8080", + "http://127.0.0.1", + "http://127.0.0.1:8080" + ] + } + }, + "API": { + "HTTPHeaders": { + "Access-Control-Allow-Origin": [ + "http://gateway.ipfs.io", + "http://ipfs.io", + "http://localhost", + "http://localhost:8080", + "http://127.0.0.1", + "http://127.0.0.1:8080" + ] + } }, "SupernodeRouting": { "Servers": []