File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- const allowedDomains = process . env . ALLOWED_REMOTE_DOMAINS . split ( "," ) || "*" ;
1+ const allowedDomains = process . env . ALLOWED_REMOTE_DOMAINS . split ( "," ) || [ "*" ] ;
22const imgproxyUrl = process . env . IMGPROXY_URL || "http://imgproxy:8080" ;
33
44Bun . serve ( {
@@ -17,8 +17,8 @@ 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 !== "*" && ! allowedDomains . includes ( origin ) ) {
21- return new Response ( " Domain not allowed. More details here: https://github.com/coollabsio/next-image-transformation" , { status : 403 } ) ;
20+ if ( allowedDomains . includes ( "*" ) && ! allowedDomains . includes ( origin ) ) {
21+ 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 ;
2424 const height = url . searchParams . get ( "height" ) || 0 ;
You can’t perform that action at this time.
0 commit comments