]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: Do not forward the header "Expect: 100-continue" when the option http-buffer...
authorThierry FOURNIER / OZON.IO <thierry.fournier@ozon.io>
Mon, 12 Dec 2016 14:19:58 +0000 (15:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 Dec 2016 16:33:42 +0000 (17:33 +0100)
When the option "http-buffer-request" is set, HAProxy send itself the
"HTTP/1.1 100 Continue" response in order to retrieve the post content.
When HAProxy forward the request, it send the body directly after the
headers. The header "Expect: 100-continue" was sent with the headers.
This header is useless because the body will be sent in all cases, and
the server reponse is not removed by haproxy.

This patch removes the header "Expect: 100-continue" if HAProxy sent it
itself.

src/proto_http.c

index 5ac9bf3cfeaa0d026bb279eba87536627877cc1f..aa8d9973e75a9408873a4c2c726442f4e20de304 100644 (file)
@@ -4914,6 +4914,7 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit
                                if (http_find_header2("Expect", 6, req->buf->p, &txn->hdr_idx, &ctx) &&
                                    unlikely(ctx.vlen == 12 && strncasecmp(ctx.line+ctx.val, "100-continue", 12) == 0)) {
                                        bo_inject(&s->res, http_100_chunk.str, http_100_chunk.len);
+                                       http_remove_header2(&txn->req, &txn->hdr_idx, &ctx);
                                }
                        }
                        msg->msg_state = HTTP_MSG_100_SENT;