From 86161fec82d0806b65405e5d67e9fdf39e3f28db Mon Sep 17 00:00:00 2001 From: cn-kali-team Date: Fri, 20 Sep 2024 23:52:14 +0800 Subject: [PATCH] fix body --- engine/src/request/http/path.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/engine/src/request/http/path.rs b/engine/src/request/http/path.rs index 804d55cd..df1b42bd 100644 --- a/engine/src/request/http/path.rs +++ b/engine/src/request/http/path.rs @@ -66,11 +66,10 @@ impl Http { for (key, value) in self.headers.clone().into_iter() { builder = builder.header(key, &value); } - if let Some(body) = &self.body { - if let Ok(request) = builder.body(slinger::Body::from(input_to_byte(body))) { - requests.push_back(Request::from(request)); - }; - } + let body = slinger::Body::from(input_to_byte(&self.body.clone().unwrap_or_default())); + if let Ok(request) = builder.body(body) { + requests.push_back(Request::from(request)); + }; } requests }