Skip to content

Commit

Permalink
fix(emby): change default value of Accept-Encoding header (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
gauthier-th authored Dec 16, 2024
1 parent de6e591 commit 7c734bc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/api/externalapi.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -34,6 +36,8 @@ class ExternalAPI {

const url = new URL(baseUrl);

const settings = getSettings();

this.defaultHeaders = {
'Content-Type': 'application/json',
Accept: 'application/json',
Expand All @@ -42,6 +46,9 @@ class ExternalAPI {
`${url.username}:${url.password}`
).toString('base64')}`,
}),
...(settings.main.mediaServerType === MediaServerType.EMBY && {
'Accept-Encoding': 'gzip',
}),
...options.headers,
};

Expand Down

0 comments on commit 7c734bc

Please sign in to comment.