Add the ability of specifying credentialed service widget headers

pull/3156/head
SunnyCloudy 2 months ago committed by GitHub
parent 7627f9c5a7
commit 25e909f4a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -20,9 +20,8 @@ export default async function credentialedProxyHandler(req, res, map) {
if (widget) {
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
const headers = {
"Content-Type": "application/json",
};
const headers = req.extraHeaders ?? widget.headers ?? {};
headers["Content-Type"] = "application/json";
if (widget.type === "coinmarketcap") {
headers["X-CMC_PRO_API_KEY"] = `${widget.key}`;

Loading…
Cancel
Save