refactor(server)!: move correlationId to X-Correlation-ID response header (#28139)

This commit is contained in:
Timon
2026-04-28 19:07:39 +02:00
committed by GitHub
parent 2624f3884f
commit 96b6165bd3
5 changed files with 6 additions and 29 deletions
+2 -3
View File
@@ -15,7 +15,6 @@ import { EnvSchema } from 'src/dtos/env.dto';
import {
DatabaseExtension,
ImmichEnvironment,
ImmichHeader,
ImmichTelemetry,
ImmichWorker,
LogFormat,
@@ -301,11 +300,11 @@ const getEnv = (): EnvData => {
mount: true,
generateId: true,
setup: (cls, req: Request, res: Response) => {
const headerValues = req.headers[ImmichHeader.Cid];
const headerValues = req.headers['x-correlation-id'];
const headerValue = Array.isArray(headerValues) ? headerValues[0] : headerValues;
const cid = headerValue || cls.get(CLS_ID);
cls.set(CLS_ID, cid);
res.header(ImmichHeader.Cid, cid);
res.header('X-Correlation-ID', cid);
},
},
},