test(extensions): 读取完整信任夹具请求头

This commit is contained in:
2026-09-08 21:34:05 +08:00
parent 888ade6b8f
commit e1040d3427
+7 -1
View File
@@ -256,7 +256,13 @@ mod tests {
for body in responses {
let (mut stream, _) = listener.accept().unwrap();
let mut bytes = [0; 8192];
stream.read(&mut bytes).unwrap();
let mut count = 0;
while !bytes[..count].windows(4).any(|w| w == b"\r\n\r\n") {
assert!(count < bytes.len());
let n = stream.read(&mut bytes[count..]).unwrap();
assert!(n > 0);
count += n;
}
let body = body.to_string();
let status = match case {
"offline" => "503 Unavailable",