Update credentialed.js

This commit is contained in:
Francisco Coelho 2022-09-11 22:11:14 +01:00
parent a304d87b8a
commit eeac1200e7

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);
var headersData if(widget.type === "gotify"){
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",}