From: Jo-Philipp Wich Date: Tue, 3 Sep 2019 14:48:31 +0000 (+0200) Subject: luci-base: luci.js: support passing FormData as request payload X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8481330e427706cc798449c6c70856b6f731196d;p=oweals%2Fluci.git luci-base: luci.js: support passing FormData as request payload Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index a9ddccf35..b4c727a39 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -360,8 +360,13 @@ break; case 'object': - content = JSON.stringify(opt.content); - contenttype = 'application/json'; + if (!(opt.content instanceof FormData)) { + content = JSON.stringify(opt.content); + contenttype = 'application/json'; + } + else { + content = opt.content; + } break; default: