don't unwrap when fullstack fails to get the path and query information from the request (#2578)

This commit is contained in:
Evan Almloff authored and GitHub committed 2024-07-02 15:31:52 -07:00
1 parent 4cab834640
commit 9bf46968cd
1 file changed
+5 -1
+5 -1
View File
@@ -381,7 +381,11 @@ pub async fn render_handler(
let build_virtual_dom = state.build_virtual_dom.clone();
let (parts, _) = request.into_parts();
let url = parts.uri.path_and_query().unwrap().to_string();
let url = parts
.uri
.path_and_query()
.ok_or(StatusCode::BAD_REQUEST)?
.to_string();
let parts: Arc<parking_lot::RwLock<http::request::Parts>> =
Arc::new(parking_lot::RwLock::new(parts));
let server_context = DioxusServerContext::from_shared_parts(parts.clone());