mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
fix widgets without mappings
This commit is contained in:
parent
d999bb3f09
commit
ec8700f3e9
@ -20,6 +20,7 @@ export default async function handler(req, res) {
|
|||||||
|
|
||||||
if (serviceProxyHandler instanceof Function) {
|
if (serviceProxyHandler instanceof Function) {
|
||||||
// map opaque endpoints to their actual endpoint
|
// map opaque endpoints to their actual endpoint
|
||||||
|
if (widget?.mappings) {
|
||||||
const mapping = widget?.mappings?.[req.query.endpoint];
|
const mapping = widget?.mappings?.[req.query.endpoint];
|
||||||
const mappingParams = mapping.params;
|
const mappingParams = mapping.params;
|
||||||
const map = mapping?.map;
|
const map = mapping?.map;
|
||||||
@ -50,6 +51,9 @@ export default async function handler(req, res) {
|
|||||||
return serviceProxyHandler(req, res, map);
|
return serviceProxyHandler(req, res, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return serviceProxyHandler(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
logger.debug("Unknown proxy service type: %s", type);
|
logger.debug("Unknown proxy service type: %s", type);
|
||||||
return res.status(403).json({ error: "Unkown proxy service type" });
|
return res.status(403).json({ error: "Unkown proxy service type" });
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user