fix
This commit is contained in:
parent
b5c4e458d4
commit
d844b495b2
|
|
@ -345,16 +345,7 @@ fn run_check_blocking(
|
|||
const MAX_BODY: usize = 10 * 1024 * 1024;
|
||||
let body_str = match resp.body_mut().read_to_string() {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
// Try reading as raw bytes (e.g. compressed or non-UTF-8 responses)
|
||||
let mut buf = Vec::new();
|
||||
let _ = std::io::Read::read_to_end(resp.body_mut().as_reader(), &mut buf);
|
||||
if buf.is_empty() {
|
||||
format!("[failed to read body: {}]", e)
|
||||
} else {
|
||||
String::from_utf8_lossy(&buf).into_owned()
|
||||
}
|
||||
}
|
||||
Err(e) => format!("[failed to read body: {}]", e),
|
||||
};
|
||||
let body_out = if body_str.len() > MAX_BODY {
|
||||
format!("[body truncated: {} bytes]", body_str.len())
|
||||
|
|
|
|||
Loading…
Reference in New Issue