mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Add Gotify Service
This commit is contained in:
@@ -12,6 +12,7 @@ const formats = {
|
||||
jellyseerr: `{url}/api/v1/{endpoint}`,
|
||||
ombi: `{url}/api/v1/{endpoint}`,
|
||||
npm: `{url}/api/{endpoint}`,
|
||||
gotify: `{url}/{endpoint}`,
|
||||
};
|
||||
|
||||
export function formatApiCall(api, args) {
|
||||
|
||||
@@ -8,15 +8,19 @@ export default async function credentialedProxyHandler(req, res) {
|
||||
if (group && service) {
|
||||
const widget = await getServiceWidget(group, service);
|
||||
|
||||
var headersData
|
||||
if(widget.type == "gotify"){
|
||||
headersData = {"X-gotify-Key": `${widget.key}`,"Content-Type": "application/json",}
|
||||
}else{
|
||||
headersData = {"X-API-Key": `${widget.key}`,"Content-Type": "application/json",}
|
||||
}
|
||||
|
||||
if (widget) {
|
||||
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
|
||||
const [status, contentType, data] = await httpProxy(url, {
|
||||
withCredentials: true,
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"X-API-Key": `${widget.key}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
headers: headersData,
|
||||
});
|
||||
|
||||
if (contentType) res.setHeader("Content-Type", contentType);
|
||||
|
||||
Reference in New Issue
Block a user