Skip to content

Commit 6c1ce9c

Browse files
committed
Fix allowedDomains condition in resize function
1 parent 8f13689 commit 6c1ce9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function resize(url) {
1717
const preset = "pr:sharp"
1818
const src = url.pathname.split("/").slice(2).join("/");
1919
const origin = new URL(src).hostname;
20-
if (allowedDomains.includes("*") && !allowedDomains.includes(origin)) {
20+
if (!allowedDomains.includes("*") && !allowedDomains.includes(origin)) {
2121
return new Response(`Domain (${origin}) not allowed. More details here: https://github.com/coollabsio/next-image-transformation`, { status: 403 });
2222
}
2323
const width = url.searchParams.get("width") || 0;

0 commit comments

Comments
 (0)