minor refactor to ServerUtilityService.addMultipartFormDataContentType
This commit is contained in:
@@ -45,14 +45,12 @@ export class ServerUtilityService {
|
|||||||
if (typeof(v) !== 'string') continue;
|
if (typeof(v) !== 'string') continue;
|
||||||
|
|
||||||
// This is just progressive conversion from undefined -> string -> string[]
|
// This is just progressive conversion from undefined -> string -> string[]
|
||||||
if (body[k]) {
|
if (!body[k]) {
|
||||||
if (Array.isArray(body[k])) {
|
|
||||||
body[k].push(v);
|
|
||||||
} else {
|
|
||||||
body[k] = [body[k], v];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
body[k] = v;
|
body[k] = v;
|
||||||
|
} else if (Array.isArray(body[k])) {
|
||||||
|
body[k].push(v);
|
||||||
|
} else {
|
||||||
|
body[k] = [body[k], v];
|
||||||
}
|
}
|
||||||
} else { // Otherwise it's a file
|
} else { // Otherwise it's a file
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user