Lambda Function URL config (for jquery JSON post)?

0

Hey folks,

I'm trying to configure my Lambda Function URL to accept a captcha protected web form post from the browser. I've enabled CORS but it is still not working.

"responded with a status of 403 () ...' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response....

I've allowed POST, but I'm guessing. Any guidance? Thanks,

M.

Mac
gefragt vor 6 Monaten137 Aufrufe
1 Antwort
0

This means that you are not including Content-Type in the list of headers included in the access-Control-Request-Headers header in your HTTP OPTIONS request.

CORS can be complex - you need to reply to that OPTIONS request (a CORS PreFlight Request) with a response that includes a Access-Control-Allow-Headers header that lists the headers out of Access-Control-Request-Headers that you would allow to be used in future CORS requests.

Refer too https://fetch.spec.whatwg.org/#http-cors-protocol for detail on how this works.

AWS
EXPERTE
beantwortet vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen