mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MINOR: h2: reject response pseudo-headers from requests
At the moment there's only ":status". Let's block it early when parsing the request. Otherwise it would be blocked by the HTTP/1 code anyway. This silences another h2spec issue. To backport to 1.8.
This commit is contained in:
parent
92153fccd3
commit
520886990f
4
src/h2.c
4
src/h2.c
@ -212,6 +212,10 @@ int h2_make_h1_request(struct http_hdr *list, char *out, int osize)
|
|||||||
*(out++) = '\n';
|
*(out++) = '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* RFC7540#8.1.2.1 mandates to reject response pseudo-headers (:status) */
|
||||||
|
if (fields & H2_PHDR_FND_STAT)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
/* Let's dump the request now if not yet emitted. */
|
/* Let's dump the request now if not yet emitted. */
|
||||||
if (!(fields & H2_PHDR_FND_NONE)) {
|
if (!(fields & H2_PHDR_FND_NONE)) {
|
||||||
ret = h2_prepare_h1_reqline(fields, phdr_val, &out, out_end);
|
ret = h2_prepare_h1_reqline(fields, phdr_val, &out, out_end);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user