fix: only append type flag to curl if type is defined (via #5041)
* issue 5040: only append type to formData file if defined * errant whitespace removal: * conform to code style * code style * use template string in nested type ternary operator
This commit is contained in:
@@ -23,7 +23,7 @@ export default function curl( request ){
|
||||
for( let [ k,v ] of request.get("body").entrySeq()) {
|
||||
curlified.push( "-F" )
|
||||
if (v instanceof win.File) {
|
||||
curlified.push( `"${k}=@${v.name};type=${v.type}"` )
|
||||
curlified.push( `"${k}=@${v.name}${v.type ? `;type=${v.type}` : ""}"` )
|
||||
} else {
|
||||
curlified.push( `"${k}=${v}"` )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user