fix(core): mobile dev server proxy URL (#10943)

This commit is contained in:
Lucas Fernandes Nogueira
2024-09-10 12:30:58 -03:00
committed by GitHub
parent 0a47bf0430
commit fafceec309
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri": patch:bug
---
Fixes mobile dev server proxy request URL with trailing slashes.

View File

@@ -102,7 +102,11 @@ fn get_response<R: Runtime>(
let decoded_path = percent_encoding::percent_decode(path.as_bytes())
.decode_utf8_lossy()
.to_string();
let url = format!("{url}{decoded_path}");
let url = format!(
"{}/{}",
url.trim_end_matches('/'),
decoded_path.trim_start_matches('/')
);
let mut proxy_builder = reqwest::ClientBuilder::new()
.build()