Compare commits

..

2 Commits

Author SHA1 Message Date
shamoon
6b1080ad43 Fix: other jsonrpc widgets broken in 0.9.8 (#3976) 2024-09-10 07:12:57 -07:00
shamoon
52a4f1a423 Fix: jsonrpchandler requires mappings (#3970)
Some checks are pending
Docker / Linting Checks (push) Waiting to run
Docker / Docker Build & Push (push) Blocked by required conditions
2024-09-10 00:13:36 -07:00
2 changed files with 8 additions and 2 deletions

View File

@@ -14,11 +14,11 @@ export async function sendJsonRpcRequest(url, method, params, widget) {
accept: "application/json",
};
if (widget.username && widget.password) {
if (widget?.username && widget?.password) {
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
}
if (widget.key) {
if (widget?.key) {
headers.Authorization = `Bearer ${widget.key}`;
}

View File

@@ -4,6 +4,12 @@ const widget = {
api: "{url}/jsonrpc",
proxyHandler: jsonrpcProxyHandler,
allowedEndpoints: /status/,
mappings: {
status: {
endpoint: "status",
},
},
};
export default widget;