Skip to content

Commit 58a3d1b

Browse files
committed
DO-1852: include cspObject property to specify CSP file
1 parent 2dbaac3 commit 58a3d1b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ export class StaticHosting extends Construct {
589589

590590
const cspPaths = props.cspPaths || [];
591591
const cspRemapPaths = cspPaths.map(cspPath => {
592-
const { path, indexPath, reportUri, fallbackCsp } = cspPath;
592+
const { path, indexPath, reportUri, fallbackCsp, cspObject } = cspPath;
593593

594594
const requestFunction = new RequestFunction(
595595
this,
@@ -604,9 +604,10 @@ export class StaticHosting extends Construct {
604604
`CSPFunction-${path}`,
605605
{
606606
bucket: `${props.subDomainName}.${props.domainName}`,
607-
reportUri: reportUri,
608-
fallbackCsp: fallbackCsp,
607+
reportUri,
608+
fallbackCsp,
609609
bucketRegion: this.bucket.env.region,
610+
cspObject,
610611
}
611612
);
612613
this.bucket.grantRead(responseFunction.edgeFunction);

0 commit comments

Comments
 (0)