diff --git a/.changes/mobile-dev-proxy-body.md b/.changes/mobile-dev-proxy-body.md new file mode 100644 index 000000000..77d684385 --- /dev/null +++ b/.changes/mobile-dev-proxy-body.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:enhance +--- + +Propagate request body on dev server mobile proxy. diff --git a/crates/tauri/src/protocol/tauri.rs b/crates/tauri/src/protocol/tauri.rs index 2d33c4a00..6a70ba272 100644 --- a/crates/tauri/src/protocol/tauri.rs +++ b/crates/tauri/src/protocol/tauri.rs @@ -115,7 +115,7 @@ fn get_response( 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( } builder.body(asset.bytes.into())? }; + if let Some(handler) = &web_resource_request_handler { handler(request, &mut response); }