Skip to content

Commit

Permalink
Update resource.ts
Browse files Browse the repository at this point in the history
Set `passthroughBehavior` behavior to `NEVER` to prevent errors for CORS preflight requests with content-types other than `application/json`.
  • Loading branch information
takeshixx committed Jul 31, 2024
1 parent 31808b4 commit a74f756
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/aws-cdk-lib/aws-apigateway/lib/resource.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Construct } from 'constructs';
import { CfnResource, CfnResourceProps } from './apigateway.generated';
import { Cors, CorsOptions } from './cors';
import { Integration } from './integration';
import { Integration, PassthroughBehavior } from './integration';
import { MockIntegration } from './integrations';
import { Method, MethodOptions, AuthorizationType } from './method';
import { IRestApi, RestApi } from './restapi';
Expand Down Expand Up @@ -295,6 +295,7 @@ export abstract class ResourceBase extends ResourceConstruct implements IResourc
integrationResponses: [
{ statusCode: `${statusCode}`, responseParameters: integrationResponseParams, responseTemplates: renderResponseTemplate() },
],
passthroughBehavior: PassthroughBehavior.NEVER,
}), {
authorizer: {
authorizerId: '',
Expand Down

0 comments on commit a74f756

Please sign in to comment.