mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-06 21:57:48 +01:00
Support extra headers in widgets
This commit is contained in:
@@ -20,11 +20,10 @@ export default async function genericProxyHandler(req, res, map) {
|
||||
if (widget) {
|
||||
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
|
||||
|
||||
let headers;
|
||||
const headers = req.extraHeaders ?? {};
|
||||
|
||||
if (widget.username && widget.password) {
|
||||
headers = {
|
||||
Authorization: `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`,
|
||||
};
|
||||
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
|
||||
}
|
||||
|
||||
const params = {
|
||||
|
||||
Reference in New Issue
Block a user