From 8f0105ccd9eebbf7a3f45cc011294a4906cf6a60 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Fri, 16 Oct 2020 17:46:22 -0700 Subject: [PATCH] don't send content-type when options is set --- src/meshwifi/meshhttp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp index a05d3d623..bba6db6da 100644 --- a/src/meshwifi/meshhttp.cpp +++ b/src/meshwifi/meshhttp.cpp @@ -379,7 +379,11 @@ void handleAPIv1ToRadio(HTTPRequest *req, HTTPResponse *res) */ // Status code is 200 OK by default. - res->setHeader("Content-Type", "application/x-protobuf"); + + if (req->getMethod() != "OPTIONS") { + res->setHeader("Content-Type", "application/x-protobuf"); + } + res->setHeader("Access-Control-Allow-Origin", "*"); res->setHeader("Access-Control-Allow-Methods", "PUT, OPTIONS");