From 4a1c028678c8ab6764809c22f2b941fcd4327db4 Mon Sep 17 00:00:00 2001 From: Shinwoo PARK Date: Thu, 27 Mar 2025 01:20:41 +0900 Subject: [PATCH] fix: fix route access in overrideBuild of nestlogged-fastify --- packages/nestlogged-fastify/src/override-patched.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nestlogged-fastify/src/override-patched.ts b/packages/nestlogged-fastify/src/override-patched.ts index cb42f27..c2d9149 100644 --- a/packages/nestlogged-fastify/src/override-patched.ts +++ b/packages/nestlogged-fastify/src/override-patched.ts @@ -116,8 +116,11 @@ export function overrideBuild, R>( const context = args[0] as ExecutionContext; if (context.getType() === 'http') { const req = context.switchToHttp().getRequest(); - route = /* supporting FastifyRequest */ req.raw ? req.raw.url : req.url; + route = req.raw.url; } + } else if (type === 'middleware') { + const req = args[0]; + route = req.originalUrl; } // Start Log