Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Response Header #3

Closed
kingferiol opened this issue Jul 8, 2020 · 0 comments
Closed

Problems with Response Header #3

kingferiol opened this issue Jul 8, 2020 · 0 comments

Comments

@kingferiol
Copy link

kingferiol commented Jul 8, 2020

Hi,

We are experimenting issue with response headers (goal is work with CORS)

This code in our lambda function but we are not able to see headers in the answer

awsProxyResponse.getHeaders().put(
	"Access-Control-Allow-Origin", "*"
);
awsProxyResponse.getHeaders().put(
	"Access-Control-Allow-Credentials", "true"
);
awsProxyResponse.getHeaders().put(
	"Access-Control-Allow-Headers",
	"Access-Control-Allow-Origin, Content-Type"
);
awsProxyResponse.getHeaders().put(
	"Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS,HEAD"
);

We tried also adding this in yaml file

    Events:
       MyApp:
         Type: AWS::Serverless::Api
         Properties:
           Path: /myapp/{proxy+}
           Method: any
           Cors:
             AllowMethods: "'GET,POST,PUT,DELETE,OPTIONS,HEAD'"
             AllowHeaders: "'Access-Control-Allow-Headers, Access-Control-Allow-Origin, Content-Type'"
             AllowOrigin: "'*'"
             AllowCredentials: True

Thanks a lot for any help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant