From 04dacdd5d99ad70dbc60853d24283fa8fc2cd50f Mon Sep 17 00:00:00 2001 From: Mirsaid Patarov Date: Mon, 12 Jul 2021 17:20:25 +0300 Subject: [PATCH] Add a JaegerMiddleware skip if this is a fallback route --- src/JaegerMiddleware.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/JaegerMiddleware.php b/src/JaegerMiddleware.php index c14ad29..445447c 100644 --- a/src/JaegerMiddleware.php +++ b/src/JaegerMiddleware.php @@ -25,8 +25,13 @@ public function __construct(Jaeger $jaeger) */ public function handle($request, Closure $next) { - $httpMethod = $request->method(); $route = Route::getRoutes()->match($request); + + if ($route->isFallback) { + return $next($request); + } + + $httpMethod = $request->method(); $uri = $route->uri(); $headers = [];