From 85d58d3a486e167fbc543a8d97f70b439e6ede61 Mon Sep 17 00:00:00 2001 From: Ken aka Frosty <90424167+KenAKAFrosty@users.noreply.github.com> Date: Wed, 5 Nov 2025 12:04:00 -0600 Subject: [PATCH] Simple but critical fix for fullstack server fn handling (#4891) Getting full panics here in prod: thread '' (23) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus-fullstack-0.7.0/src/magic.rs:554:22: called `Result::unwrap()` on an `Err` value: Response { status: 500, version: HTTP/1.1, headers: {"content-type": "application/json"}, body: Body(UnsyncBoxBody) } Could be triggered by something as simple as a client choosing to send formdata-style body instead of JSON. (I discovered this because exactly that was happening; not maliciously, but because of the upgrade from 0.6.3 to 0.7). As far as I can tell, this was just meant to be an early return with a failure case of the Response, mapped from the ServerFnError. The .unwrap() left there was probably just an erroneous artifact from the various waves of the development process. If this is incorrect or I've missed something, please let me know! But I believe this is a very simple fix for an otherwise critical problem --- packages/fullstack/src/magic.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/fullstack/src/magic.rs b/packages/fullstack/src/magic.rs index 02c4b8cad..36c7c5d75 100644 --- a/packages/fullstack/src/magic.rs +++ b/packages/fullstack/src/magic.rs @@ -550,8 +550,7 @@ pub mod req_from { let out = serde_json::from_slice::(bytes) .map(map) - .map_err(|e| ServerFnError::from(e).into_response()) - .unwrap(); + .map_err(|e| ServerFnError::from(e).into_response())?; Ok((out, headers)) }