Skip to content

Instantly share code, notes, and snippets.

@antklim
Created July 18, 2022 21:49
Show Gist options
  • Save antklim/baa2c8c74fe6ed78131b9940a20fee12 to your computer and use it in GitHub Desktop.
Save antklim/baa2c8c74fe6ed78131b9940a20fee12 to your computer and use it in GitHub Desktop.
FormDataCORS:
Type: AWS::ApiGateway::Method
Properties:
AuthorizationType: NONE
HttpMethod: OPTIONS
ResourceId: !Ref FormDataResource
RestApiId: !Ref APIGW
Integration:
Type: MOCK
PassthroughBehavior: WHEN_NO_MATCH
RequestTemplates:
application/json: |
{"statusCode": 200}
IntegrationResponses:
- StatusCode: 200
ResponseParameters:
method.response.header.Access-Control-Allow-Headers: "'Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token'"
method.response.header.Access-Control-Allow-Methods: "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'"
method.response.header.Access-Control-Allow-Origin: "'*'"
ResponseTemplates:
application/json: ''
MethodResponses:
- StatusCode: 200
ResponseParameters:
method.response.header.Access-Control-Allow-Headers: true
method.response.header.Access-Control-Allow-Methods: true
method.response.header.Access-Control-Allow-Origin: true
ResponseModels:
application/json: Empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment