@@ -217,16 +217,15 @@ function addFormDataBody (snippet, body, opts) {
217217 }
218218
219219 if ( data . type === 'file' ) {
220- const sanitizedSrc = sanitize ( data . src , opts . trim , '"' , true ) ,
221- wrappedSrc = `@"${ sanitizedSrc } "` ,
222- finalSrc = sanitize ( wrappedSrc , opts . trim , opts . quoteType , opts . quoteType === '"' ) ;
223- snippet += ` ${ opts . quoteType } ${ sanitize ( data . key , opts . trim , opts . quoteType ) } =${ finalSrc } ` ;
220+ const sanitizedSrc = sanitize ( data . src , opts . trim , opts . quoteType ) ;
221+ snippet += `${ opts . indent } ${ form ( '-f' , opts . format ) } ` +
222+ `${ opts . quoteType } ${ sanitize ( data . key , opts . trim , opts . quoteType ) } =@${ sanitizedSrc } ` ;
224223 snippet += opts . quoteType ;
225224 }
226225 else {
227226 const sanitizedValue = sanitize ( data . value , opts . trim , '"' , true ) ,
228227 finalValue = sanitize ( sanitizedValue , opts . trim , opts . quoteType , opts . quoteType === '"' ) ;
229- snippet += `${ opts . indent } ${ form ( '-f' , opts . format ) } ` +
228+ snippet += `${ opts . indent } ${ form ( '-f' , opts . format ) } ` +
230229 `${ opts . quoteType } ${ sanitize ( data . key , opts . trim , opts . quoteType ) } =${ finalValue } ` ;
231230 snippet += opts . quoteType ;
232231 }
0 commit comments