javtiful fix

This commit is contained in:
Simon
2026-04-30 06:04:51 +00:00
committed by ForgeCode
parent 698644c5f8
commit 6a4fc98720
3 changed files with 70 additions and 61 deletions

View File

@@ -653,6 +653,7 @@ pub fn strip_url_scheme(url: &str) -> String {
#[allow(dead_code)]
pub fn build_proxy_url(options: &ServerOptions, proxy: &str, target: &str) -> String {
println!("Building proxy URL with options={:?}, proxy={}, target={}", options, proxy, target);
let target = target.trim_start_matches('/');
let base = options
.public_url_base
@@ -660,6 +661,10 @@ pub fn build_proxy_url(options: &ServerOptions, proxy: &str, target: &str) -> St
.unwrap_or("")
.trim_end_matches('/');
if target.starts_with("http://") || target.starts_with("https://") {
return format!("/proxy/{target}");
}
if base.is_empty() {
format!("/proxy/{proxy}/{target}")
} else {