Skip to content

Commit

Permalink
fix: trusted proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldietzler committed Dec 23, 2024
1 parent b88f98b commit 404a6ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/src/repositories/config.repository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('getEnv', () => {
it('should return default network options', () => {
const { network } = getEnv();
expect(network).toEqual({
trustedProxies: [],
trustedProxies: ['linklocal', 'uniquelocal'],
});
});

Expand Down
2 changes: 1 addition & 1 deletion server/src/repositories/config.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const getEnv = (): EnvData => {
licensePublicKey: isProd ? productionKeys : stagingKeys,

network: {
trustedProxies: dto.IMMICH_TRUSTED_PROXIES ?? [],
trustedProxies: dto.IMMICH_TRUSTED_PROXIES ?? ['linklocal', 'uniquelocal'],
},

otel: {
Expand Down
2 changes: 1 addition & 1 deletion server/src/workers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function bootstrap() {

logger.setContext('Bootstrap');
app.useLogger(logger);
app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal', ...network.trustedProxies]);
app.set('trust proxy', ['loopback', ...network.trustedProxies]);
app.set('etag', 'strong');
app.use(cookieParser());
app.use(json({ limit: '10mb' }));
Expand Down

0 comments on commit 404a6ac

Please sign in to comment.