@@ -213,7 +213,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan
213213 . setHeader ( 'Content-type' , response . mimetype )
214214 . setHeader (
215215 'Content-Disposition' ,
216- 'inline; filename="' + response . fileName + '"' ,
216+ 'inline; filename="' + encodeURIComponent ( response . fileName ) + '"' ,
217217 ) ;
218218
219219 const transform : Transform = response . stream ;
@@ -231,7 +231,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan
231231 const form = new FormData ( ) ;
232232
233233 form . append ( 'mediaType' , response . mediaType ) ;
234- form . append ( 'fileName' , response . fileName ) ;
234+ form . append ( 'fileName' , encodeURIComponent ( response . fileName ) ) ;
235235 form . append ( 'size' , JSON . stringify ( response . size ) ) ;
236236 form . append ( 'mimetype' , response . mimetype ) ;
237237
@@ -240,7 +240,7 @@ export function ChatRouter(chatController: ChatController, ...guards: RequestHan
240240 }
241241
242242 form . append ( 'file' , response . stream , {
243- filename : response . filename ,
243+ filename : encodeURIComponent ( response . fileName ) ,
244244 contentType : response . mimetype ,
245245 } ) ;
246246
0 commit comments