dev #14

Merged
Mathis merged 13 commits from dev into prod 2026-01-20 10:12:18 +01:00
Showing only changes of commit f080919563 - Show all commits

View File

@@ -1,6 +1,6 @@
import { createHash } from "node:crypto";
import { Injectable, Logger, NestMiddleware } from "@nestjs/common";
import { NextFunction, Request, Response } from "express";
import { createHash } from "node:crypto";
@Injectable()
export class HTTPLoggerMiddleware implements NestMiddleware {
@@ -16,7 +16,7 @@ export class HTTPLoggerMiddleware implements NestMiddleware {
const contentLength = response.get("content-length");
const duration = Date.now() - startTime;
const hashedIp = createHash("sha256").update(ip).digest("hex");
const hashedIp = createHash("sha256").update(ip as string).digest("hex");
const message = `${method} ${originalUrl} ${statusCode} ${contentLength || 0} - ${userAgent} ${hashedIp} +${duration}ms`;
if (statusCode >= 500) {