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
asked 7 months ago153 views
1 Answer
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
EXPERT
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions