Project
vgrep
Description
The custom HTTP client implementation in client.rs skips reading the HTTP status line and assumes all responses are successful. If the server returns 4xx or 5xx errors, the client ignores the status and attempts to parse the error response as a valid JSON result, leading to confusing error messages.
Error Message
Error: Failed to parse server response
Debug Logs
System Information
Bounty Version: 0.1.0
OS: Ubuntu 24.04 LTS
CPU: AMD EPYC-Genoa Processor (8 cores)
RAM: 15 GB
Screenshots
No response
Steps to Reproduce
- Start vgrep server
- Trigger a server error (e.g., invalid request)
- Observe the client error message doesn't mention HTTP status
Expected Behavior
The client should:
- Parse and validate the HTTP status line (e.g.,
HTTP/1.1 200 OK)
- Return appropriate errors for non-2xx status codes
- Include status code in error messages
Actual Behavior
The client skips status line parsing and reads body directly:
// Read headers (SKIPS status line!)
loop {
let mut line = String::new();
reader.read_line(&mut line)?;
if line == "\r\n" || line.is_empty() {
break;
}
}
// Read body (assumes success)
reader.read_to_string(&mut response)?;
Additional Context
No response
Project
vgrep
Description
The custom HTTP client implementation in
client.rsskips reading the HTTP status line and assumes all responses are successful. If the server returns 4xx or 5xx errors, the client ignores the status and attempts to parse the error response as a valid JSON result, leading to confusing error messages.Error Message
Debug Logs
System Information
Screenshots
No response
Steps to Reproduce
Expected Behavior
The client should:
HTTP/1.1 200 OK)Actual Behavior
The client skips status line parsing and reads body directly:
Additional Context
No response