]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h1-htx: Sanitize parsing to properly handle upgrade requests
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 May 2026 13:35:46 +0000 (15:35 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 May 2026 16:28:07 +0000 (18:28 +0200)
commit3843f48faf3aee2cee827d5ae93bf72ba7f86530
treed26bb383596393bf199147c515ba9e60ffb92c7e
parentb238c08015e986da330252cd6197f185308fca57
BUG/MEDIUM: h1-htx: Sanitize parsing to properly handle upgrade requests

Thanks to previous patches, the request messages are now sanitized to
properly handle Upgrade requests. Now, if a 'connection: upgrade' header
value was found while no 'Upgrade' header, the 'upgrade' values is removed
from the 'connection' header. Conversely the opposite is also performed. If
'Upgrade' header was found, but no "conneciotn: upgrade" header value, all
occurrences of 'Upgrade' header are refused.

This patch depends on following ones:
  * MINOR: h1: Add  a H1M flag to specify a non-empty 'Upgrade:' header was parsed
  * MINOR: http: Add function to remove all occurrences of a value in a header

It should fix the issue 3397. But the H2 part should be reviewed too, and
probably the H1 response parsing, to be consistent with this change.

The series should be backported as far as 2.4.
include/haproxy/htx-t.h
src/h1_htx.c