]> git.ipfire.org Git - thirdparty/curl.git/commit
http: reject HTTP major version switch mid connection
authorDaniel Stenberg <daniel@haxx.se>
Fri, 19 Apr 2024 08:27:04 +0000 (10:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 19 Apr 2024 11:34:00 +0000 (13:34 +0200)
commita032e97f2b1070497c0f8c8972bc892e70686838
tree735d189db15f2027773e02d54dc15e9e5f54f0f6
parent123d3ef5dbdc3755999e6a71dd1b79e5877b82c4
http: reject HTTP major version switch mid connection

A connection that has seen an HTTP major version now refuses any other
major HTTP version in future responses. Previously, a HTTP/1.x
connection would just silently accept HTTP/2 or HTTP/3 in the status
lines as long as it had support for those built-in. It would then just
lead to confusion and badness.

Indirectly Spotted by CodeSonar which identified a duplicate assignment
in this function.

Add test 471 to verify

Closes #13421
lib/http.c
tests/data/Makefile.inc
tests/data/test471 [new file with mode: 0644]