javtiful fix
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user