From 8414f4a6a341ba7ecb911f2e7316c968da577cdc Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Fri, 16 Oct 2020 16:36:52 -0700 Subject: [PATCH] Added access-control-allow headers --- src/meshwifi/meshhttp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp index 38492db38..db705ebb5 100644 --- a/src/meshwifi/meshhttp.cpp +++ b/src/meshwifi/meshhttp.cpp @@ -332,6 +332,8 @@ void handleAPIv1FromRadio(HTTPRequest *req, HTTPResponse *res) // Status code is 200 OK by default. res->setHeader("Content-Type", "application/x-protobuf"); + res->setHeader("Access-Control-Allow-Origin", "*"); + res->setHeader("Access-Control-Allow-Methods", "PUT, GET"); uint8_t txBuf[MAX_STREAM_BUF_SIZE]; @@ -359,6 +361,8 @@ void handleAPIv1ToRadio(HTTPRequest *req, HTTPResponse *res) // Status code is 200 OK by default. res->setHeader("Content-Type", "application/x-protobuf"); + res->setHeader("Access-Control-Allow-Origin", "*"); + res->setHeader("Access-Control-Allow-Methods", "PUT, GET"); byte buffer[MAX_TO_FROM_RADIO_SIZE]; size_t s = req->readBytes(buffer, MAX_TO_FROM_RADIO_SIZE);