http: warn once for response 100-continue already seen

Avoids pushing multiple log messages, when the consumer will
only set one app-layer event for the tx
Also, this is a warning, not an error, as we continue parsing.

Ticket: 8867
pull/16213/head
Philippe Antoine 2 months ago committed by Victor Julien
parent 1ce0e303e7
commit 4dd7ebf079

@ -446,10 +446,14 @@ impl ConnectionParser {
_ => {
let response_tx = self.response_mut().unwrap();
if response_tx.seen_100continue {
htp_error!(
let mut flags = 0; // unused but needed by macro
htp_warn_once!(
self.logger,
HtpLogCode::CONTINUE_ALREADY_SEEN,
"Already seen 100-Continue."
"Already seen 100-Continue.",
self.response_mut().unwrap().flags,
flags,
HtpFlags::FIELD_100_CONTINUE
);
}
// Expecting to see another response line next.

@ -141,6 +141,8 @@ impl HtpFlags {
pub const RESPONSE_MISSING_BYTES: u64 = (0x0020_0000_0000 | Self::MISSING_BYTES);
/// Too many headers, log only once.
pub const HEADERS_TOO_MANY: u64 = 0x0040_0000_0000;
/// 100-Continue already seen.
pub const FIELD_100_CONTINUE: u64 = 0x0080_0000_0000;
}
#[allow(clippy::upper_case_acronyms)]

Loading…
Cancel
Save