There was an error while loading. Please reload this page.
2 parents 23d3d70 + 72dcc5b commit c8a5311Copy full SHA for c8a5311
1 file changed
src/dispatch.rs
@@ -325,7 +325,7 @@ pub async fn run_rsgi(
325
pyo3_async_runtimes::tokio::into_future(aw)
326
})?;
327
let body_obj: PyObject = read_fut.await?;
328
- let body_bytes: Vec<u8> = Python::with_gil(|py| -> PyResult<Vec<u8>> {
+ let mut body_bytes: Vec<u8> = Python::with_gil(|py| -> PyResult<Vec<u8>> {
329
let b = body_obj.bind(py);
330
if let Ok(x) = b.extract::<Vec<u8>>() {
331
return Ok(x);
@@ -521,7 +521,8 @@ pub async fn run_rsgi(
521
.await
522
}
523
};
524
- let parsed = match form::parse_multipart(body_bytes.clone(), &boundary).await {
+ let multipart_body = std::mem::take(&mut body_bytes);
525
+ let parsed = match form::parse_multipart(multipart_body, &boundary).await {
526
Ok(p) => p,
527
Err(e) => {
528
return response::send_text(
0 commit comments