BUG/MINOR: http-htx: Don't make http_find_header() fail if the value is empty

http_find_header() is used to find the next occurrence of a header matching on
its name. When found, the matching header is returned with the corresponding
value. This value may be empty. Unfortunatly, because of a bug, an empty value
make the function fail.

This patch must be backported to 2.1, 2.0 and 1.9.

(cherry picked from commit f3ad62996fa3bab907429ce25a2ada10186b4242)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c4c499b812ab306c7ecd0d2fcc9eb7e0a3175c41)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
This commit is contained in:
Christopher Faulet 2019-11-29 11:18:45 +01:00
parent 200c6215fe
commit 6d9a455da1

View File

@ -109,8 +109,6 @@ int http_find_header(const struct htx *htx, const struct ist name,
v.len--; v.len--;
ctx->lws_after++; ctx->lws_after++;
} }
if (!v.len)
continue;
ctx->blk = blk; ctx->blk = blk;
ctx->value = v; ctx->value = v;
return 1; return 1;