Skip to content

Commit

Permalink
Merge pull request #1360 from aligent/fix/reorder_custom_behavior
Browse files Browse the repository at this point in the history
reorder custom behaviors to be evaluated before other static mappings
  • Loading branch information
crispy101 authored May 9, 2024
2 parents e971d91 + 27ffe2f commit 8de9dd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/static-hosting/lib/static-hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ export class StaticHosting extends Construct {

const additionalBehaviors: Record<string, Writeable<BehaviorOptions>> = {};

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

if (props.backendHost) {
backendOrigin = new HttpOrigin(props.backendHost);

Expand Down Expand Up @@ -525,11 +530,6 @@ export class StaticHosting extends Construct {
}
}

// 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 Down
2 changes: 1 addition & 1 deletion packages/static-hosting/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aligent/cdk-static-hosting",
"version": "2.0.0",
"version": "2.3.1",
"main": "index.js",
"license": "GPL-3.0-only",
"homepage": "https://github.com/aligent/aws-cdk-static-hosting-stack#readme",
Expand Down

0 comments on commit 8de9dd5

Please sign in to comment.