From: ducloc464 Date: Fri, 14 Feb 2025 11:00:16 +0000 (+0700) Subject: fix: configure lxc container POST request X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=3bac133986e7828cd0c5aa22af40e1bf95036180;p=project%2Fluci.git fix: configure lxc container POST request Signed-off-by: ducloc464 --- diff --git a/applications/luci-app-lxc/luasrc/controller/lxc.lua b/applications/luci-app-lxc/luasrc/controller/lxc.lua index 1682def279..5b603e52d9 100644 --- a/applications/luci-app-lxc/luasrc/controller/lxc.lua +++ b/applications/luci-app-lxc/luasrc/controller/lxc.lua @@ -140,6 +140,7 @@ function lxc_configuration_set(lxc_name) luci.http.prepare_content("text/plain") local lxc_configuration = luci.http.formvalue("lxc_conf") + lxc_configuration = luci.http.urldecode(lxc_configuration, true) if lxc_configuration == nil then util.perror("lxc error: config formvalue is empty") return diff --git a/applications/luci-app-lxc/luasrc/view/lxc.htm b/applications/luci-app-lxc/luasrc/view/lxc.htm index 69025ad6d3..e5d261c6e8 100644 --- a/applications/luci-app-lxc/luasrc/view/lxc.htm +++ b/applications/luci-app-lxc/luasrc/view/lxc.htm @@ -250,7 +250,7 @@ local target = nx.uname().machine var lxc_name = textarea.dataset['id']; var lxc_conf = textarea.value; - new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, "lxc_conf=" + encodeURIComponent(lxc_conf), + new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, {"lxc_conf": encodeURIComponent(lxc_conf)}, function(x) { if (!x || x.responseText != "0")