Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reorder custom behaviors to be evaluated before other static mappings #1360

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading