From: Willy Tarreau Date: Mon, 23 Nov 2026 08:47:23 +0000 (+0100) Subject: MINOR: http_ana: always drop the Expect header in HTTP/1.0 X-Git-Url: https://git.kaiwu.me/http/$%7BGITURL%7D$%7Bcid%7D?a=commitdiff_plain;h=ced0ded1d5a4346d0839cb8f0b645a4e9a8c59a5;p=haproxy.git MINOR: http_ana: always drop the Expect header in HTTP/1.0 The Expect header wasn't specified in HTTP/1.0, and its only known value 100-continue isn't usable there. Yet it continues to fool various servers and reverse-proxies. Let's just drop it when seen in 1.0 requests to be sure not to respond. --- diff --git a/src/http_ana.c b/src/http_ana.c index fb87d5ec4..9d208798a 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -213,6 +213,14 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit) goto return_bad_req; } + /* Note that Expect: is not supported in HTTP/1.0 and must be dropped */ + if (unlikely(!(msg->flags & HTTP_MSGF_VER_11))) { + struct http_hdr_ctx ctx = { .blk = NULL }; + + while (http_find_header(htx, ist("expect"), &ctx, 1)) + http_remove_header(htx, &ctx); + } + /* * 2: check if the URI matches the monitor_uri. We have to do this for * every request which gets in, because the monitor-uri is defined by