Skip to content

Commit 1de4899

Browse files
authored
fix(images): allow any local path when no localPatterns are specified (#1032)
1 parent 07919d8 commit 1de4899

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/cloudflare/src/cli/build/open-next/compile-images.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,11 @@ const defaultFormats = ["image/webp"];
7979

8080
const defaultMinimumCacheTTLSec = 14400;
8181

82-
const defaultLocalPatterns = { pathname: "/**" };
82+
// Allow any local image when no localPatterns are specified.
83+
// This regexp was generated using the image manifest generated by setting the local patterns
84+
// to [{ pathname: "/**" }] in the next config.
85+
const defaultLocalPatterns = [
86+
{
87+
pathname: "^(?:\\/(?!\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?))$",
88+
},
89+
];

0 commit comments

Comments
 (0)