]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: h2: the TE header if present may only contain trailers
authorWilly Tarreau <w@1wt.eu>
Sun, 3 Dec 2017 17:41:31 +0000 (18:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 3 Dec 2017 20:08:42 +0000 (21:08 +0100)
h2spec reports this issue which has no side effect for now, but is
better cleared.

To backport to 1.8.

src/h2.c

index 3c580d196847074f33a3004f4a337ebc33a1ec69..41565c04bbd0da95d234aa5040c17839b0f123ad 100644 (file)
--- a/src/h2.c
+++ b/src/h2.c
@@ -179,6 +179,9 @@ int h2_make_h1_request(struct http_hdr *list, char *out, int osize)
                if (isteq(list[idx].n, ist("host")))
                        fields |= H2_PHDR_FND_HOST;
 
+               if (isteq(list[idx].n, ist("te")) && !isteq(list[idx].v, ist("trailers")))
+                       goto fail;
+
                /* cookie requires special processing at the end */
                if (isteq(list[idx].n, ist("cookie"))) {
                        list[idx].n.len = -1;