fix: Set connect endpoint on correct field in MethodRouter (#3656)

This commit is contained in:
Sindri Pétur Ingimundarson
2026-04-03 08:49:48 +02:00
committed by Alice Ryhl
parent 6fd77f82ca
commit 27f4015986
+5 -2
View File
@@ -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]