Adding "Access-Control-Allow-Origin" custom header to AWS Appsync GraphQL Response


I want to add / change "Access-Control-Allow-Origin" and "Strict-Transport-Security" headers in my Appsync response. I found a method for sending the custom headers ( in res.vtl file and I am able to set the "Strict-Transport-Security" header by using that method.

But when I tried the same for "Access-Control-Allow-Origin", it is throwing the error "The header name Access-Control-Allow-Origin is restricted and cannot be included as a custom header."

Any other way, we can modify this header value?

No Answers

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