From 43ad11dc75d2f6513f1d884c031e789b419b3b72 Mon Sep 17 00:00:00 2001 From: "Thierry FOURNIER / OZON.IO" Date: Mon, 12 Dec 2016 15:19:58 +0100 Subject: [PATCH] MINOR: Do not forward the header "Expect: 100-continue" when the option http-buffer-request is set 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/proto_http.c b/src/proto_http.c index 5ac9bf3cf..aa8d9973e 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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;