mirror of
https://github.com/immich-app/immich
synced 2026-08-22 13:13:05 +00:00
* chore(deps): update dependency eslint-plugin-unicorn to v70 * fix: linting --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
13 lines
454 B
TypeScript
13 lines
454 B
TypeScript
import { serverVersion } from 'src/constants';
|
|
|
|
export function configureUserAgent() {
|
|
const originalFetch = fetch;
|
|
// eslint-disable-next-line unicorn/no-global-object-property-assignment
|
|
globalThis.fetch = (input, init) => {
|
|
const headers = new Headers(init?.headers);
|
|
if (!headers.has('User-Agent')) {
|
|
headers.set('User-Agent', `immich-server/${serverVersion}`);
|
|
}
|
|
return originalFetch(input, { ...init, headers });
|
|
};
|
|
}
|