added api key authentication
might work, unable to test
This commit is contained in:
parent
da57b2779a
commit
50c26e2524
@ -25,7 +25,9 @@ export default async function genericProxyHandler(req, res, map) {
|
||||
|
||||
const headers = req.extraHeaders ?? widget.headers ?? {};
|
||||
|
||||
if (widget.username && widget.password) {
|
||||
if (widget.key) {
|
||||
headers.Authorization = `${widget.key}`;
|
||||
} else if (widget.username && widget.password) {
|
||||
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user