diff --git a/volo-http/src/server/route/router.rs b/volo-http/src/server/route/router.rs index 6b087d30..a4e41e36 100644 --- a/volo-http/src/server/route/router.rs +++ b/volo-http/src/server/route/router.rs @@ -419,7 +419,9 @@ where ) -> Result { if let Ok(matched) = self.matcher.at(req.uri().clone().path()) { if let Some(route) = self.routes.get(matched.value) { - cx.params_mut().extend(matched.params); + if !matched.params.is_empty() { + cx.params_mut().extend(matched.params); + } return route.call(cx, req).await; } }