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

This commit is contained in:
Evan Almloff 2024-07-03 00:31:52 +02:00 committed by GitHub
parent 4cab834640
commit 9bf46968cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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());