mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
minor refactor to ServerUtilityService.addMultipartFormDataContentType
This commit is contained in:
parent
3b44e11799
commit
f7ca7a2cc0
1 changed files with 5 additions and 7 deletions
|
@ -45,14 +45,12 @@ export class ServerUtilityService {
|
|||
if (typeof(v) !== 'string') continue;
|
||||
|
||||
// This is just progressive conversion from undefined -> string -> string[]
|
||||
if (body[k]) {
|
||||
if (Array.isArray(body[k])) {
|
||||
body[k].push(v);
|
||||
} else {
|
||||
body[k] = [body[k], v];
|
||||
}
|
||||
} else {
|
||||
if (!body[k]) {
|
||||
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
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue