From 8a65f411667c75c6295b4d70f052b23c71b524db Mon Sep 17 00:00:00 2001 From: Magnus Dahl Eide Date: Sat, 21 Jun 2025 10:55:20 +0200 Subject: [PATCH 1/2] add(image): add content-security-policy and content-disposition --- .../open-next/src/adapters/image-optimization-adapter.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/open-next/src/adapters/image-optimization-adapter.ts b/packages/open-next/src/adapters/image-optimization-adapter.ts index 1058e4dd0..d3b06257c 100644 --- a/packages/open-next/src/adapters/image-optimization-adapter.ts +++ b/packages/open-next/src/adapters/image-optimization-adapter.ts @@ -169,6 +169,11 @@ function buildSuccessResponse( Vary: "Accept", "Content-Type": result.contentType, "Cache-Control": `public,max-age=${result.maxAge},immutable`, + "Content-Disposition": + nextConfig.images.contentDispositionType ?? "attachment", + "Content-Security-Policy": + nextConfig.images.contentSecurityPolicy ?? + "script-src 'none'; frame-src 'none'; sandbox;", }; debug("result", result); if (etag) { From f7075ee86c155e19898f86586fe9f46b82530fe8 Mon Sep 17 00:00:00 2001 From: Magnus Dahl Eide Date: Sat, 21 Jun 2025 11:05:44 +0200 Subject: [PATCH 2/2] changeset --- .changeset/thirty-carrots-relate.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/thirty-carrots-relate.md diff --git a/.changeset/thirty-carrots-relate.md b/.changeset/thirty-carrots-relate.md new file mode 100644 index 000000000..45f4cf2f3 --- /dev/null +++ b/.changeset/thirty-carrots-relate.md @@ -0,0 +1,5 @@ +--- +"@opennextjs/aws": patch +--- + +chore(image): add content-security-policy and content-disposition