Skip to content

Commit

Permalink
DO-1531: merge props additional behaviours
Browse files Browse the repository at this point in the history
  • Loading branch information
gowrizrh committed Sep 26, 2023
1 parent c5ee21c commit 567a58f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/static-hosting/lib/static-hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,13 @@ export class StaticHosting extends Construct {
}
}

const mergedAdditionalBehaviors = {};

// If additional behaviours are provided via props, then merge, overriding generated behaviours if required.
if (props.additionalBehaviors) {
Object.assign(additionalBehaviors, props.additionalBehaviors);
}

const distributionProps: DistributionProps = {
domainNames: domainNames,
webAclId: props.webAclArn,
Expand All @@ -351,7 +358,7 @@ export class StaticHosting extends Construct {
props.certificateArn
),
defaultBehavior: defaultBehavior,
additionalBehaviors: additionalBehaviors,
additionalBehaviors: mergedAdditionalBehaviors,
errorResponses: props.enableErrorConfig ? errorResponses : [],
};

Expand Down

0 comments on commit 567a58f

Please sign in to comment.