|
|
|
@ -21,9 +21,13 @@ export default async function tdarrProxyHandler(req, res) {
|
|
|
|
|
logger.debug("Invalid or missing widget for service '%s' in group '%s'", service, group);
|
|
|
|
|
return res.status(400).json({ error: "Invalid proxy service type" });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const headers = {
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
};
|
|
|
|
|
if (widget.key) {
|
|
|
|
|
headers["x-api-key"] = `${widget.key}`;
|
|
|
|
|
}
|
|
|
|
|
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint: undefined, ...widget }));
|
|
|
|
|
|
|
|
|
|
const [status, contentType, data] = await httpProxy(url, {
|
|
|
|
|
method: "POST",
|
|
|
|
|
body: JSON.stringify({
|
|
|
|
@ -33,9 +37,7 @@ export default async function tdarrProxyHandler(req, res) {
|
|
|
|
|
docID: "statistics",
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
headers: {
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
headers,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (status !== 200) {
|
|
|
|
|