Compare commits

...

1 Commits

Author SHA1 Message Date
Gauthier
6a100de2ec fix(emby): change default value of Accept-Encoding header 2024-12-10 20:02:05 +01:00

View File

@@ -1,3 +1,5 @@
import { MediaServerType } from '@server/constants/server';
import { getSettings } from '@server/lib/settings';
import type { RateLimitOptions } from '@server/utils/rateLimit'; import type { RateLimitOptions } from '@server/utils/rateLimit';
import rateLimit from '@server/utils/rateLimit'; import rateLimit from '@server/utils/rateLimit';
import type NodeCache from 'node-cache'; import type NodeCache from 'node-cache';
@@ -34,6 +36,8 @@ class ExternalAPI {
const url = new URL(baseUrl); const url = new URL(baseUrl);
const settings = getSettings();
this.defaultHeaders = { this.defaultHeaders = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
Accept: 'application/json', Accept: 'application/json',
@@ -42,6 +46,9 @@ class ExternalAPI {
`${url.username}:${url.password}` `${url.username}:${url.password}`
).toString('base64')}`, ).toString('base64')}`,
}), }),
...(settings.main.mediaServerType === MediaServerType.EMBY && {
'Accept-Encoding': 'gzip',
}),
...options.headers, ...options.headers,
}; };