Http2HeadersFrameWithStartline(header_buffer, header_len, data_buffer, data_len, session_data_,
source_id_, stream_)
{
- if (!process_frame)
- return;
-
if (source_id == SRC_CLIENT)
start_line_generator = new Http2RequestLine(session_data->events[source_id],
session_data->infractions[source_id]);
void Http2HeadersFrameHeader::analyze_http1()
{
- if (!process_frame)
- return;
-
HttpFlowData* http_flow;
if (!process_start_line(http_flow, source_id))
return;
Http2HeadersFrame(header_buffer, header_len, data_buffer, data_len, session_data_, source_id_,
stream_)
{
- if (!process_frame)
- return;
-
if (!(get_flags() & FLAG_END_STREAM))
{
// Trailers without END_STREAM flag set.
void Http2HeadersFrameTrailer::analyze_http1()
{
- if (!process_frame)
- return;
-
HttpFlowData* const http_flow = stream->get_hi_flow_data();
assert(http_flow);
+ const bool valid_headers = http1_header.length() > 0;
if (http_flow->get_type_expected(source_id) != HttpEnums::SEC_TRAILER)
{
// http_inspect is not yet expecting trailers. Flush empty buffer through scan, reassemble,
// and eval to prepare http_inspect for trailers.
assert(http_flow->get_type_expected(source_id) == HttpEnums::SEC_BODY_H2);
- stream->finish_msg_body(source_id, true, true); // calls http_inspect scan()
+ stream->finish_msg_body(source_id, valid_headers, true); // calls http_inspect scan()
unsigned copied;
const StreamBuffer stream_buf =
dummy_pkt.dsize = stream_buf.length;
dummy_pkt.data = stream_buf.data;
session_data->hi->eval(&dummy_pkt);
- assert (http_flow->get_type_expected(source_id) == HttpEnums::SEC_TRAILER);
+ assert (!valid_headers || http_flow->get_type_expected(source_id) == HttpEnums::SEC_TRAILER);
if (http_flow->get_type_expected(source_id) == HttpEnums::SEC_ABORT)
{
stream->set_state(source_id, STREAM_ERROR);
}
}
+ if (!valid_headers)
+ {
+ stream->set_state(source_id, STREAM_ERROR);
+ return;
+ }
+
process_decoded_headers(http_flow, source_id);
}