From 27021cfbc13c3760677b9818ec49f1984cdaca98 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 19 Jan 2024 13:38:36 +0800 Subject: [PATCH] fix: redundant / added at end of forward url in proxy if rest is empty --- crates/proxy/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/proxy/src/lib.rs b/crates/proxy/src/lib.rs index 25ff9489b..bb1f46e64 100644 --- a/crates/proxy/src/lib.rs +++ b/crates/proxy/src/lib.rs @@ -219,6 +219,8 @@ where format!("{}{}", upstream.trim_end_matches('/'), rest) } else if upstream.ends_with('/') || rest.starts_with('/') { format!("{}{}", upstream, rest) + } else if rest.is_empty() { + upstream.to_string() } else { format!("{}/{}", upstream, rest) };