From 2ac37508c878a0b18785a298264371c878e15b6e Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 30 Oct 2022 01:00:39 +0200 Subject: [PATCH] CORS HEADER --- 12345.sh | 1 + templates/index.http | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/12345.sh b/12345.sh index c2163f9d..1f8b4016 100755 --- a/12345.sh +++ b/12345.sh @@ -50,6 +50,7 @@ while true; do # REPLACE myIP in http response template sed "s~127.0.0.1:12345~$myIP:$PORT~g" $HOME/.zen/Astroport.ONE/templates/index.http > ~/.zen/tmp/123/${MOATS}.myIP.http sed -i "s~127.0.0.1~$myIP~g" ~/.zen/tmp/123/${MOATS}.myIP.http + sed -i "s~:12345~:$PORT~g" ~/.zen/tmp/123/${MOATS}.myIP.http sed -i "s~_IPFSNODEID_~${IPFSNODEID}~g" ~/.zen/tmp/123/${MOATS}.myIP.http ## NODE PUBLISH HOSTED WHAT'S JSON sed -i "s~_HOSTNAME_~$(hostname)~g" ~/.zen/tmp/123/${MOATS}.myIP.http ## HOSTNAME diff --git a/templates/index.http b/templates/index.http index c32abe91..06e7b271 100644 --- a/templates/index.http +++ b/templates/index.http @@ -1,11 +1,14 @@ HTTP/1.1 200 OK Server: Astroport Content-Type: text/html; charset=UTF-8 +Access-Control-Allow-Origin = "*" +Access-Control-Allow-Credentials = "true" +Access-Control-Allow-Methods = "GET" - +