Update Jellyfin proxy auth header formatting

This commit is contained in:
shamoon
2025-12-23 12:52:59 -08:00
parent 724e04efbd
commit 4cd55808d0

View File

@@ -24,11 +24,14 @@ export default async function jellyfinProxyHandler(req, res, map) {
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget })); const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
const deviceIdRaw = widget.deviceId ?? `${widget.service_group || "group"}-${widget.service_name || "service"}`;
const deviceId = encodeURIComponent(deviceIdRaw);
const authHeader = `MediaBrowser Token="${encodeURIComponent(
widget.key,
)}", Client="Homepage", Device="Homepage", DeviceId="${deviceId}", Version="1.0.0"`;
const headers = { const headers = {
Authorization: `MediaBrowser Token=${widget.key}`, Authorization: authHeader,
"Content-Type": "application/json",
"X-Emby-Token": widget.key,
"X-MediaBrowser-Token": widget.key,
}; };
const params = { const params = {