Revert "Update credentialed.js"

This reverts commit eeac1200e7aa22c94a4f3992a58f440eb7f3f2b5.
This commit is contained in:
Francisco Coelho 2022-09-12 09:31:44 +01:00
parent 9d790894d5
commit af02440c40

View File

@ -3,13 +3,13 @@ import { formatApiCall } from "utils/api-helpers";
import { httpProxy } from "utils/http"; import { httpProxy } from "utils/http";
export default async function credentialedProxyHandler(req, res) { export default async function credentialedProxyHandler(req, res) {
let headersData
const { group, service, endpoint } = req.query; const { group, service, endpoint } = req.query;
if (group && service) { if (group && service) {
const widget = await getServiceWidget(group, service); const widget = await getServiceWidget(group, service);
if(widget.type === "gotify"){ var headersData
if(widget.type == "gotify"){
headersData = {"X-gotify-Key": `${widget.key}`,"Content-Type": "application/json",} headersData = {"X-gotify-Key": `${widget.key}`,"Content-Type": "application/json",}
}else{ }else{
headersData = {"X-API-Key": `${widget.key}`,"Content-Type": "application/json",} headersData = {"X-API-Key": `${widget.key}`,"Content-Type": "application/json",}