From fc3cdcb8759f09b9f9a83c3025f00b51dd9ab025 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Tue, 10 Dec 2024 20:02:05 +0100 Subject: [PATCH] fix(emby): change default value of Accept-Encoding header --- server/api/externalapi.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/api/externalapi.ts b/server/api/externalapi.ts index 0dc1f967d..f27752d4c 100644 --- a/server/api/externalapi.ts +++ b/server/api/externalapi.ts @@ -1,3 +1,5 @@ +import { MediaServerType } from '@server/constants/server'; +import { getSettings } from '@server/lib/settings'; import type { RateLimitOptions } from '@server/utils/rateLimit'; import rateLimit from '@server/utils/rateLimit'; import type NodeCache from 'node-cache'; @@ -34,6 +36,8 @@ class ExternalAPI { const url = new URL(baseUrl); + const settings = getSettings(); + this.defaultHeaders = { 'Content-Type': 'application/json', Accept: 'application/json', @@ -42,6 +46,9 @@ class ExternalAPI { `${url.username}:${url.password}` ).toString('base64')}`, }), + ...(settings.main.mediaServerType === MediaServerType.EMBY && { + 'Accept-Encoding': 'gzip', + }), ...options.headers, };