Merge pull request #1383 from mcclurec/transmission-rpc-url

Allow setting rpcUrl path for Transmission widget
pull/1396/head
shamoon 2 years ago committed by GitHub
commit 656cb4ba30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,7 +33,9 @@ export default async function transmissionProxyHandler(req, res) {
cache.put(`${headerCacheKey}.${service}`, headers); cache.put(`${headerCacheKey}.${service}`, headers);
} }
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget })); const api = `${widget.url}${widget.rpcUrl || widgets[widget.type].rpcUrl}rpc`;
const url = new URL(formatApiCall(api, { endpoint, ...widget }));
const csrfHeaderName = "x-transmission-session-id"; const csrfHeaderName = "x-transmission-session-id";
const method = "POST"; const method = "POST";

@ -1,7 +1,7 @@
import transmissionProxyHandler from "./proxy"; import transmissionProxyHandler from "./proxy";
const widget = { const widget = {
api: "{url}/transmission/rpc", rpcUrl: "/transmission/",
proxyHandler: transmissionProxyHandler, proxyHandler: transmissionProxyHandler,
}; };

Loading…
Cancel
Save