Added support for JavaScript FormData

As preparation for 2FA plugins and easier Fetch calls
This commit is contained in:
djmaze 2021-07-23 11:40:03 +02:00
parent 5a0f6c2b9f
commit 0a69c6410d
5 changed files with 26 additions and 31 deletions

View file

@ -47,7 +47,11 @@ abort = (sAction, bClearOnly) => {
fetchJSON = (action, sGetAdd, params, timeout, jsonCallback) => {
sGetAdd = pString(sGetAdd);
params = params || {};
params.Action = action;
if (params instanceof FormData) {
params.set('Action', action);
} else {
params.Action = action;
}
let init = {};
if (window.AbortController) {
abort(action);