From 27f40159865f7fd485655a3e663d4bcb491df2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindri=20P=C3=A9tur=20Ingimundarson?= Date: Fri, 13 Feb 2026 22:05:24 +0100 Subject: [PATCH] fix: Set connect endpoint on correct field in MethodRouter (#3656) --- axum/src/routing/method_routing.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/axum/src/routing/method_routing.rs b/axum/src/routing/method_routing.rs index 338d89c4..ed07c576 100644 --- a/axum/src/routing/method_routing.rs +++ b/axum/src/routing/method_routing.rs @@ -931,7 +931,7 @@ where set_endpoint( "CONNECT", - &mut self.options, + &mut self.connect, &endpoint, filter, MethodFilter::CONNECT, @@ -1400,13 +1400,16 @@ mod tests { #[crate::test] async fn merge() { - let mut svc = get(ok).merge(post(ok)); + let mut svc = get(ok).merge(post(ok)).merge(connect(ok)); let (status, _, _) = call(Method::GET, &mut svc).await; assert_eq!(status, StatusCode::OK); let (status, _, _) = call(Method::POST, &mut svc).await; assert_eq!(status, StatusCode::OK); + + let (status, _, _) = call(Method::CONNECT, &mut svc).await; + assert_eq!(status, StatusCode::OK); } #[crate::test]