mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat(server): log http exceptions (#9996)
This commit is contained in:
parent
ce985ef8f8
commit
0f976edf96
9 changed files with 91 additions and 18 deletions
|
|
@ -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);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue