Kurnal saini
Kurnal saini

Reputation: 103

How do I stop CORS from rejecting my Lambda-Proxy that I create in AWS API Gateway?

{
            "Access-Control-Allow-Headers": "Content-Type",
            "Access-Control-Allow-Origin": "*",
            "Access-Control-Allow-Methods": "PUT,OPTIONS"
}

originally I was using this since my API is a PUT request but it kept saying that one of my header fields (called access) was being rejected.

I then did this but to no avail.

{
            "Access-Control-Allow-Headers": "Content-Type",
            "Access-Control-Allow-Origin": "access",
            "Access-Control-Allow-Methods": "PUT,OPTIONS"
}

Upvotes: 0

Views: 54

Answers (1)

Elias Soares
Elias Soares

Reputation: 10254

You must put your header to Access-Control-Allow-Headers:

Access-Control-Allow-Headers: Content-Type, access

Upvotes: 1

Related Questions