Fix banner bug with HTTP proxies

This commit is contained in:
B. Blechschmidt 2024-02-26 01:24:22 +01:00
parent b3314f5abc
commit 01a0d9164d

View file

@ -172,6 +172,8 @@ impl HttpConnection {
return Ok(());
}
let header_size = self.counter;
self.counter = 0;
self.crlf_state = 0;
@ -192,7 +194,9 @@ impl HttpConnection {
if status_code == 200 {
// Connection successful
self.state = HttpState::Established;
self.server_inbuf.clear();
// The server may have sent a banner already (SMTP, SSH, etc.).
// Therefore, server_inbuf must retain this data.
self.server_inbuf.drain(0..header_size);
return self.state_change().await;
}