From b62f50c8e30eb04e8de2e98d6217549ac512f1e4 Mon Sep 17 00:00:00 2001 From: Peter Colapietro Date: Thu, 9 Dec 2021 17:20:36 -0500 Subject: [PATCH] feat: update `cors` definitions for `httpApi` in yaml template see: https://github.com/redwoodjs/redwood/pull/3755#discussion_r763526904 Co-authored-by: Kurt Hutten --- .../setup/deploy/providers/aws-serverless.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/setup/deploy/providers/aws-serverless.js b/packages/cli/src/commands/setup/deploy/providers/aws-serverless.js index a9283e338109..2f5d7824f16a 100644 --- a/packages/cli/src/commands/setup/deploy/providers/aws-serverless.js +++ b/packages/cli/src/commands/setup/deploy/providers/aws-serverless.js @@ -27,7 +27,18 @@ provider: runtime: nodejs14.x region: us-east-2 # This is the AWS region where the service will be deployed. httpApi: # HTTP API is used by default. To learn about the available options in API Gateway, see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html - cors: true + cors: + allowOrigins: + - '*' # This is the default value. You can remove this line if you want to restrict the CORS to a specific origin. + allowCredentials: true + allowedHeaders: + - authorization + - auth-provider + - content-Type + - X-Amz-Date + - X-Api-Key + - X-Amz-Security-Token + - X-Amz-User-Agent payload: '1.0' useProviderTags: true # https://www.serverless.com/framework/docs/deprecations/#AWS_HTTP_API_USE_PROVIDER_TAGS stackTags: # Add CloudFormation stack tags here