]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: http-htx: Loop on full host value during scheme based normalization
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Apr 2026 09:34:36 +0000 (11:34 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 29 Apr 2026 08:03:39 +0000 (10:03 +0200)
During scheme based normalization, when the authority is normalized, the
host headers are updated accordingly. Only full host header values must be
updated. Comma-separated list are not expected here.

It is important to do so to be consistant with other places where the host
header is updated (when the request URI is changed for instance).

src/http_htx.c

index c25ab6991743bf9998e55d3e38d138631a4926c2..cc5e4ecad6523fee29ff84f6ae6bc953f9b069e3 100644 (file)
@@ -1886,9 +1886,9 @@ int http_scheme_based_normalize(struct htx *htx)
 
                http_replace_stline(htx, meth, uri, vsn);
 
-               /* replace every host headers values by the normalized host */
+               /* replace every host headers by the normalized host */
                ctx.blk = NULL;
-               while (http_find_header(htx, ist("host"), &ctx, 0)) {
+               while (http_find_header(htx, ist("host"), &ctx, 1)) {
                        if (!http_replace_header_value(htx, &ctx, host)) {
                                free_trash_chunk(temp);
                                goto fail;