fix(core): request body on dev proxy for mobile

This commit is contained in:
Lucas Nogueira 2024-10-23 09:06:36 -03:00
parent ce864cebfd
commit 418db7109a
No known key found for this signature in database
GPG Key ID: A05EE2227C581CD7
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch:enhance
---
Propagate request body on dev server mobile proxy.

View File

@ -115,7 +115,7 @@ fn get_response<R: Runtime>(
for (name, value) in request.headers() {
proxy_builder = proxy_builder.header(name, value);
}
match crate::async_runtime::block_on(proxy_builder.send()) {
match crate::async_runtime::block_on(proxy_builder.body(request.body().clone()).send()) {
Ok(r) => {
let mut response_cache_ = response_cache.lock().unwrap();
let mut response = None;
@ -159,6 +159,7 @@ fn get_response<R: Runtime>(
}
builder.body(asset.bytes.into())?
};
if let Some(handler) = &web_resource_request_handler {
handler(request, &mut response);
}