Fix cargo clippy issue
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -137,13 +137,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
let buff = if !modified_headers {
|
let buff = if !modified_headers {
|
||||||
|
|
||||||
// Check for URL prefix
|
// Check for URL prefix
|
||||||
if let Some(prefix) = &args.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}")) {
|
&& !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.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!");
|
client_write.flush().await.expect("Failed to flush response to client!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
modified_headers = true;
|
modified_headers = true;
|
||||||
manipulate_headers(&buf_client[..count], &args.upstream_dns)
|
manipulate_headers(&buf_client[..count], &args.upstream_dns)
|
||||||
|
Reference in New Issue
Block a user