security fix

https://github.com/ltdrdata/ComfyUI-Manager/issues/594
This commit is contained in:
dr.lt.data
2024-04-22 10:16:11 +09:00
parent 8f1b013e26
commit 2e5eb70db3
3 changed files with 15 additions and 13 deletions

View File

@@ -89,7 +89,10 @@ export async function install_pip(packages) {
if(packages.includes('&'))
app.ui.dialog.show(`Invalid PIP package enumeration: '${packages}'`);
const res = await api.fetchApi(`/customnode/install/pip?packages=${packages}`);
const res = await api.fetchApi("/customnode/install/pip", {
method: "POST",
body: packages,
});
if(res.status == 200) {
app.ui.dialog.show(`PIP package installation is processed.<br>To apply the pip packages, please click the <button id='cm-reboot-button3'><font size='3px'>RESTART</font></button> button in ComfyUI.`);
@@ -121,7 +124,10 @@ export async function install_via_git_url(url, manager_dialog) {
app.ui.dialog.show(`Wait...<BR><BR>Installing '${url}'`);
app.ui.dialog.element.style.zIndex = 10010;
const res = await api.fetchApi(`/customnode/install/git_url?url=${url}`);
const res = await api.fetchApi("/customnode/install/git_url", {
method: "POST",
body: url,
});
if(res.status == 200) {
app.ui.dialog.show(`'${url}' is installed<BR>To apply the installed custom node, please <button id='cm-reboot-button4'><font size='3px'>RESTART</font></button> ComfyUI.`);