diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-09-03 16:48:31 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-09-10 15:28:16 +0200 |
commit | 8481330e427706cc798449c6c70856b6f731196d (patch) | |
tree | a422ab6c7c3f544cbbf97d0788199cb1d18a2f92 /modules/luci-base/htdocs/luci-static/resources | |
parent | d5e6688072e345dd0e455b0832b4393994e9be7c (diff) |
luci-base: luci.js: support passing FormData as request payload
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/luci.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index a9ddccf359..b4c727a399 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: |