mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-01 21:13:39 +01:00
Suppory body in widget endpoint mappings
This commit is contained in:
parent
2367564041
commit
e35a66d3f1
@ -32,6 +32,7 @@ export default async function handler(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
req.method = mapping?.method || "GET";
|
req.method = mapping?.method || "GET";
|
||||||
|
if (mapping?.body) req.body = mapping?.body;
|
||||||
req.query.endpoint = endpoint;
|
req.query.endpoint = endpoint;
|
||||||
|
|
||||||
if (req.query.segments) {
|
if (req.query.segments) {
|
||||||
|
@ -27,10 +27,15 @@ export default async function genericProxyHandler(req, res, map) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const [status, contentType, data] = await httpProxy(url, {
|
const params = {
|
||||||
method: req.method,
|
method: req.method,
|
||||||
headers,
|
headers,
|
||||||
});
|
}
|
||||||
|
if (req.body) {
|
||||||
|
params.body = req.body;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [status, contentType, data] = await httpProxy(url, params);
|
||||||
|
|
||||||
let resultData = data;
|
let resultData = data;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user