File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ export async function handleResponse(
172172 case 'image/jpeg' :
173173 extension = '.jpeg' ;
174174 break ;
175- case 'webp' :
175+ case 'image/ webp' :
176176 extension = '.webp' ;
177177 break ;
178178 }
Original file line number Diff line number Diff line change @@ -107,5 +107,20 @@ describe('daemon client', () => {
107107 const response = await handleResponse ( unsupportedContentResponse , 'md' ) ;
108108 assert . ok ( response . includes ( '.png' ) ) ;
109109 } ) ;
110+
111+ it ( 'uses the webp extension for WebP images' , async ( ) => {
112+ const webpContentResponse = {
113+ content : [
114+ {
115+ type : 'image' as const ,
116+ data : 'base64data' ,
117+ mimeType : 'image/webp' ,
118+ } ,
119+ ] ,
120+ structuredContent : { } ,
121+ } ;
122+ const response = await handleResponse ( webpContentResponse , 'md' ) ;
123+ assert . ok ( response . includes ( '.webp' ) ) ;
124+ } ) ;
110125 } ) ;
111126} ) ;
You can’t perform that action at this time.
0 commit comments