mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +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;
|
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 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue