File tree 1 file changed +1
-6
lines changed
plugin/src/templates/edge
1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,16 @@ const defaultFormat = "webp"
13
13
// deno-lint-ignore require-await
14
14
const handler = async ( req : Request , context : Context ) => {
15
15
const { searchParams } = new URL ( req . url ) ;
16
- console . log ( { imageconfig, headers : req . headers } )
17
16
const accept = new Accepts ( req . headers ) ;
18
17
const { formats = [ defaultFormat ] } = imageconfig ;
19
18
if ( formats . length === 0 ) {
20
19
formats . push ( defaultFormat ) ;
21
20
}
22
- let type = accept . types ( formats )
23
- console . log ( 'Accepted types:' , type )
24
- type ||= defaultFormat ;
21
+ let type = accept . types ( formats ) || defaultFormat ;
25
22
if ( Array . isArray ( type ) ) {
26
23
type = type [ 0 ] ;
27
24
}
28
25
29
- console . log ( 'Resolved type to:' , type )
30
26
31
27
const source = searchParams . get ( "url" ) ;
32
28
const width = searchParams . get ( "w" ) ;
@@ -48,7 +44,6 @@ const handler = async (req: Request, context: Context) => {
48
44
modifiers . push ( `f_${ type } ` ) ;
49
45
}
50
46
const target = `/_ipx/${ modifiers . join ( "," ) } /${ encodeURIComponent ( source ) } ` ;
51
- console . log ( 'Loading image from' , target )
52
47
return context . rewrite (
53
48
target ,
54
49
) ;
You can’t perform that action at this time.
0 commit comments