Removing property instead of recreating object
This commit is contained in:
parent
6e59ed6a0d
commit
6df3765258
@ -20,7 +20,7 @@ export default async function credentialedProxyHandler(req, res, map) {
|
|||||||
if (widget) {
|
if (widget) {
|
||||||
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
|
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
|
||||||
|
|
||||||
let headers = {
|
const headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ export default async function credentialedProxyHandler(req, res, map) {
|
|||||||
} else if (widget.type === "proxmox") {
|
} else if (widget.type === "proxmox") {
|
||||||
headers.Authorization = `PVEAPIToken=${widget.username}=${widget.password}`;
|
headers.Authorization = `PVEAPIToken=${widget.username}=${widget.password}`;
|
||||||
} else if (widget.type === "proxmoxbackupserver") {
|
} else if (widget.type === "proxmoxbackupserver") {
|
||||||
headers = {};
|
delete headers["Content-Type"];
|
||||||
headers.Authorization = `PBSAPIToken=${widget.username}:${widget.password}`;
|
headers.Authorization = `PBSAPIToken=${widget.username}:${widget.password}`;
|
||||||
} else if (widget.type === "autobrr") {
|
} else if (widget.type === "autobrr") {
|
||||||
headers["X-API-Token"] = `${widget.key}`;
|
headers["X-API-Token"] = `${widget.key}`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user