Skip to content

Commit fafceec

Browse files
authored
fix(core): mobile dev server proxy URL (#10943)
1 parent 0a47bf0 commit fafceec

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:bug
3+
---
4+
5+
Fixes mobile dev server proxy request URL with trailing slashes.

crates/tauri/src/protocol/tauri.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ fn get_response<R: Runtime>(
102102
let decoded_path = percent_encoding::percent_decode(path.as_bytes())
103103
.decode_utf8_lossy()
104104
.to_string();
105-
let url = format!("{url}{decoded_path}");
105+
let url = format!(
106+
"{}/{}",
107+
url.trim_end_matches('/'),
108+
decoded_path.trim_start_matches('/')
109+
);
106110

107111
let mut proxy_builder = reqwest::ClientBuilder::new()
108112
.build()

0 commit comments

Comments
 (0)