mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MINOR: filters: Count HTTP headers as filtered data but don't forward them
In flt_analyze_http_headers() HTTP analyzer, we must not forward systematically the headers. We must only count them as filtered data (ie. increment the offset of the right size). It is the http_payload callback responsibility to decide to forward headers or not by forwarding at least 1 byte of payload. And there is always at least 1 byte of payload to forward, the EOM block. This patch depends on following commits: * MINOR: filters: Forward data only if the last filter forwards something * MINOR: http-htx: Add a function to retrieve the headers size of an HTX message This patch must be backported with commits above as far as 1.9. In HAProxy 2.0 and 1.9, the patch must be adapted because of the legacy HTTP code.
This commit is contained in:
parent
71179a3ea9
commit
9c44e4813c
@ -774,7 +774,16 @@ flt_analyze_http_headers(struct stream *s, struct channel *chn, unsigned int an_
|
|||||||
BREAK_EXECUTION(s, chn, check_result);
|
BREAK_EXECUTION(s, chn, check_result);
|
||||||
}
|
}
|
||||||
} RESUME_FILTER_END;
|
} RESUME_FILTER_END;
|
||||||
channel_htx_fwd_headers(chn, htxbuf(&chn->buf));
|
|
||||||
|
if (HAS_DATA_FILTERS(s, chn)) {
|
||||||
|
size_t data = http_get_hdrs_size(htxbuf(&chn->buf));
|
||||||
|
struct filter *f;
|
||||||
|
|
||||||
|
list_for_each_entry(f, &strm_flt(s)->filters, list) {
|
||||||
|
if (IS_DATA_FILTER(f, chn))
|
||||||
|
FLT_OFF(f, chn) = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
check_result:
|
check_result:
|
||||||
ret = handle_analyzer_result(s, chn, an_bit, ret);
|
ret = handle_analyzer_result(s, chn, an_bit, ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user