From 5525454baf924e4f67f3b032ad5be334396ba8e5 Mon Sep 17 00:00:00 2001 From: Shinwoo PARK Date: Sun, 30 Mar 2025 03:21:51 +0900 Subject: [PATCH] fix(nestlogged): add url parsing from request logic for middleware --- packages/nestlogged/src/logged/override.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nestlogged/src/logged/override.ts b/packages/nestlogged/src/logged/override.ts index 3feeab4..f59f09d 100644 --- a/packages/nestlogged/src/logged/override.ts +++ b/packages/nestlogged/src/logged/override.ts @@ -126,12 +126,15 @@ export function overrideBuild, R>( } // If this is ExecutionContext based function (e.g. Guard, Interceptor) get Request from Context - if (type === 'guard' || type === 'interceptor' || type === 'middleware') { + if (type === 'guard' || type === 'interceptor') { const context = args[0] as ExecutionContext; if (context.getType() === 'http') { const req = context.switchToHttp().getRequest(); route = req.url; } + } else if (type === 'middleware') { + const req = args[0]; + route = req.url; } // Start Log