Skip to content

Commit ce5f4f1

Browse files
authored
Merge pull request #1536 from aligent/chore/DO-1802_undefined_additional_behavior_path
Chore/do 1802 undefined additional behavior path
2 parents 521d419 + ad08ac2 commit ce5f4f1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.changeset/tame-donkeys-unite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aligent/cdk-static-hosting": patch
3+
---
4+
5+
Fixed undefined error for Static Hosting additionalBehavior paths

packages/static-hosting/lib/static-hosting.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,12 @@ export class StaticHosting extends Construct {
679679
if (props.responseHeadersPolicies?.additionalBehaviorResponsePolicy) {
680680
for (const path in props.responseHeadersPolicies
681681
.additionalBehaviorResponsePolicy) {
682-
additionalBehaviors[path].responseHeadersPolicy =
683-
props.responseHeadersPolicies.additionalBehaviorResponsePolicy[path];
682+
if (additionalBehaviors[path]) {
683+
additionalBehaviors[path].responseHeadersPolicy =
684+
props.responseHeadersPolicies.additionalBehaviorResponsePolicy[
685+
path
686+
];
687+
}
684688
}
685689
}
686690

0 commit comments

Comments
 (0)