mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-11 03:12:07 +08:00
Merge branch 'main' of https://github.com/xicopitz/homepage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user