Fix cargo clippy issue
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-08-28 08:07:41 +02:00
parent 85fa873bb9
commit 387a53261c

View File

@@ -137,13 +137,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
let buff = if !modified_headers {
// Check for URL prefix
if let Some(prefix) = &args.prefix {
if !String::from_utf8_lossy(&buf_client[..count]).split_once('\n').map(|l|l.0).unwrap_or("").contains(&format!(" {prefix}")) {
if let Some(prefix) = &args.prefix
&& !String::from_utf8_lossy(&buf_client[..count]).split_once('\n').map(|l|l.0).unwrap_or("").contains(&format!(" {prefix}")) {
client_write.write_all(b"HTTP/1.1 401 Forbidden\r\n\r\nNot proxifiable.\r\n").await.expect("Failed to respond to client");
client_write.flush().await.expect("Failed to flush response to client!");
return;
}
}
modified_headers = true;
manipulate_headers(&buf_client[..count], &args.upstream_dns)