Add the ability of specifying credentialed service widget headers
This commit is contained in:
parent
7627f9c5a7
commit
25e909f4a6
@ -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…
Reference in New Issue
Block a user