alma-cdk / openapix

Combine the power of AWS CDK & OpenAPI YAML Schema Definitions
https://constructs.dev/packages/@alma-cdk/openapix/
94 stars 6 forks source link

CorsIntegration does not return Access-Control-Allow-Origin="*" #39

Closed bkovacki closed 1 year ago

bkovacki commented 1 year ago

Configuring CorsIntegration on OPTIONS method with options.origins: "*" or options.origins: CorsOrigins.ANY does not return Access-Control-Allow-Origin header in OPTIONS response.

Code example:

new openapix.Api(this, "TestAPI", {
  source: testApiSource,
  paths: {
    "/test": 
      post: new openapix.LambdaIntegration(this, testFunction),
      options: new CorsIntegration(this, {
        headers: "'Content-Type,X-Amz-Date,Authorization'",
        origins: "*",
        methods: "'POST, OPTIONS'",
      }),
    },
  },
});
mpiltz commented 1 year ago

Thank you for opening this issue.