mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28:47 +00:00
Merge branch 'main' of https://github.com/xicopitz/homepage
This commit is contained in:
commit
a304d87b8a
32 changed files with 597 additions and 203 deletions
|
@ -18,11 +18,16 @@ export default async function credentialedProxyHandler(req, res) {
|
|||
if (widget) {
|
||||
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
|
||||
const [status, contentType, data] = await httpProxy(url, {
|
||||
method: req.method,
|
||||
withCredentials: true,
|
||||
credentials: "include",
|
||||
headers: headersData,
|
||||
});
|
||||
|
||||
if (status === 204 || status === 304) {
|
||||
return res.status(status).end();
|
||||
}
|
||||
|
||||
if (contentType) res.setHeader("Content-Type", contentType);
|
||||
return res.status(status).send(data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue