fix proxmox proxy post body parsing issue

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-02-24 22:34:19 +00:00
parent ce8a4f29fa
commit 62eca6c427

View File

@ -40,7 +40,7 @@ app.get("/api/proxmox/*", async (req, res) => { // proxy endpoint for GET proxmo
app.post("/api/proxmox/*", async (req, res) => { // proxy endpoint for POST proxmox api with no token app.post("/api/proxmox/*", async (req, res) => { // proxy endpoint for POST proxmox api with no token
path = req.url.replace("/api/proxmox", ""); path = req.url.replace("/api/proxmox", "");
let result = await requestPVE(path, "POST", req.cookies, req.body); let result = await requestPVE(path, "POST", req.cookies, JSON.stringify(req.body)); // need to stringify body because of other issues
res.send(result.data, result.status); res.send(result.data, result.status);
}); });