Skip to content

Commit

Permalink
enhance code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Park committed Sep 5, 2024
1 parent cf37d62 commit 3e1954c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/static-hosting/lib/static-hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,13 @@ export class StaticHosting extends Construct {
),
});

const additionalDefaultCacheKeyHeaders =
props.additionalDefaultCacheKeyHeaders || [];
const cacheHeaderBehaviorAllowList = [
"x-forwarded-host", // Origin response may vary depending on the domain/path based on Feature Environment
"x-prerender", // Origin response may vary depending on whether the request is from end user or prerender service.
...additionalDefaultCacheKeyHeaders,
];
if (props.additionalDefaultCacheKeyHeaders) {
props.additionalDefaultCacheKeyHeaders.forEach(header => {
cacheHeaderBehaviorAllowList.push(header);
});
}
const originCachePolicy =
props.defaultBehaviorCachePolicy ||
new CachePolicy(this, "S3OriginCachePolicy", {
Expand Down

0 comments on commit 3e1954c

Please sign in to comment.