From 07ab2567c81c21071b4aa81cbd5a98babd896f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Soboci=C5=84ski?= Date: Sat, 4 Feb 2023 01:02:03 +0100 Subject: [PATCH] fix: fix routes with array of method --- src/fastify-metrics.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fastify-metrics.ts b/src/fastify-metrics.ts index d85ec01..bbc52d7 100644 --- a/src/fastify-metrics.ts +++ b/src/fastify-metrics.ts @@ -297,7 +297,7 @@ export class FastifyMetrics implements IFastifyMetrics { if ( this.routesWhitelist.has( FastifyMetrics.getRouteSlug({ - method: request.routerMethod, + method: request.method, url: request.routerPath, }) ) @@ -324,7 +324,7 @@ export class FastifyMetrics implements IFastifyMetrics { request.routeConfig.statsId ?? request.routerPath ?? this.routeFallback; - const method = request.routerMethod ?? request.method; + const method = request.method; const labels = { [this.routeMetrics.labelNames.method]: method,