mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
BUG/MINOR: h1: Reject empty coding name as last transfer-encoding value
The following Transfer-Encoding header is now rejected with a 400-bad-request: Transfer-Encoding: chunked,\r\n This case was not properly handled and the last empty value was just ignored. This patch must be backported as far as 2.6.
This commit is contained in:
parent
b8b0102760
commit
428451fe96
4
src/h1.c
4
src/h1.c
@ -140,6 +140,10 @@ int h1_parse_xfer_enc_header(struct h1m *h1m, struct ist value)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
n = http_find_hdr_value_end(word.ptr, e); // next comma or end of line
|
n = http_find_hdr_value_end(word.ptr, e); // next comma or end of line
|
||||||
|
|
||||||
|
/* a comma at the end means the last value is empty */
|
||||||
|
if (n+1 == e)
|
||||||
|
goto fail;
|
||||||
word.len = n - word.ptr;
|
word.len = n - word.ptr;
|
||||||
|
|
||||||
/* trim trailing blanks */
|
/* trim trailing blanks */
|
||||||
|
Loading…
Reference in New Issue
Block a user