Open jschoch opened 10 months ago
Searching for "The request client is not a secure context and the resource is in more-private address space private
" says that it is Chrome blocking the request".
Have you tried to make the "context" secure if you run your app on https: instead of http:?
it is an esp32 that is crunching interrupts to run my lathe so HTTPS may be too much to ask.
here's the code for the esp32 https://github.com/jschoch/ESPels/blob/dev/src/src/web.cpp#L932
and the react code is here https://github.com/jschoch/espELSfrontend/blob/dev/src/App.js#L200
also, i saw in the documentation that the preflight example they used issues a 204, not a 200. I'd wonder if that is an issue on the server side but it never actually makes the OPTIONS request since I'm logging that and never see it.
@jschoch I didn't use esp32, but you use DefaultHeaders::Instance().addHeader("Access-Control-Allow-Headers", "*");
, this can put Access-Control-Allow-Headers
to all response headers?
this is my guess。
I am using Node.js as the backend, and I am encountering the CORS
error as well.
Last method to slove is add response head Access-Control-Allow-Headers: *
。
God bless you!
I'm connecting to an ESP32 running espasyncwebserver. I want to serve my react app via amazon S3. After battling much I've managed to get firefox working but chrome refuses to send the preflight.
my react is something like this
my esp32 is something like this
same code in firefox is working great
and here are the headers
chrome doesn't even show any headers, and my esp32 never see's a OPTIONS request. it seems to be blocked in chrome before it can be sent
the console log in chrome says:
at a complete loss as how to trouble shoot this.
I can share the fulll sources but I need to deal with some git issues right now. let me know if you need more source.