From 993cc418f9e61ae3d436a0a47626d502ab1bd2ed Mon Sep 17 00:00:00 2001 From: ducloc464 Date: Fri, 14 Feb 2025 18:00:16 +0700 Subject: [PATCH] fix: configure lxc container POST request Signed-off-by: Loc Nguyen --- applications/luci-app-lxc/luasrc/controller/lxc.lua | 1 + applications/luci-app-lxc/luasrc/view/lxc.htm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/luci-app-lxc/luasrc/controller/lxc.lua b/applications/luci-app-lxc/luasrc/controller/lxc.lua index 1682def2799e..5b603e52d910 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 69025ad6d392..e5d261c6e8a0 100644 --- a/applications/luci-app-lxc/luasrc/view/lxc.htm +++ b/applications/luci-app-lxc/luasrc/view/lxc.htm @@ -250,7 +250,7 @@

<%:Create New Container%>

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")