mirror of
https://github.com/immich-app/immich.git
synced 2025-11-25 12:00:42 +09:00
feat(server): log http exceptions (#9996)
This commit is contained in:
@@ -6,6 +6,7 @@ import { Request, Response } from 'express';
|
||||
import { RedisOptions } from 'ioredis';
|
||||
import Joi from 'joi';
|
||||
import { CLS_ID, ClsModuleOptions } from 'nestjs-cls';
|
||||
import { ImmichHeader } from 'src/dtos/auth.dto';
|
||||
import { ConcurrentQueueName, QueueName } from 'src/interfaces/job.interface';
|
||||
|
||||
export enum TranscodePolicy {
|
||||
@@ -419,11 +420,11 @@ export const clsConfig: ClsModuleOptions = {
|
||||
mount: true,
|
||||
generateId: true,
|
||||
setup: (cls, req: Request, res: Response) => {
|
||||
const headerValues = req.headers['x-immich-cid'];
|
||||
const headerValues = req.headers[ImmichHeader.CID];
|
||||
const headerValue = Array.isArray(headerValues) ? headerValues[0] : headerValues;
|
||||
const cid = headerValue || cls.get(CLS_ID);
|
||||
cls.set(CLS_ID, cid);
|
||||
res.header('x-immich-cid', cid);
|
||||
res.header(ImmichHeader.CID, cid);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user