]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h1: add headers to the list after controls, not before
authorWilly Tarreau <w@1wt.eu>
Fri, 14 Sep 2018 14:28:15 +0000 (16:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Sep 2018 15:40:35 +0000 (17:40 +0200)
This will ease removal/skipping of duplicates such as content-length.

src/h1.c

index b78f5847a580d853f7addec0e01a7729cd93d930..65e7495afb8d51f1ee013a94df9b71ba81f0b532 100644 (file)
--- a/src/h1.c
+++ b/src/h1.c
@@ -1271,8 +1271,6 @@ int h1_headers_to_hdr_list(char *start, const char *stop,
                                goto http_output_full;
                        }
 
-                       http_set_hdr(&hdr[hdr_count++], n, v);
-
                        if (isteqi(n, ist("transfer-encoding"))) {
                                h1m->flags &= ~H1_MF_CLEN;
                                h1m->flags |= H1_MF_CHNK;
@@ -1285,6 +1283,8 @@ int h1_headers_to_hdr_list(char *start, const char *stop,
                        else if (isteqi(n, ist("connection"))) {
                                h1_parse_connection_header(h1m, v);
                        }
+
+                       http_set_hdr(&hdr[hdr_count++], n, v);
                }
 
                sol = ptr - start;