From: Thierry FOURNIER / OZON.IO Date: Mon, 12 Dec 2016 14:19:58 +0000 (+0100) Subject: MINOR: Do not forward the header "Expect: 100-continue" when the option http-buffer... X-Git-Tag: v1.8-dev1~294 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43ad11dc75d2f6513f1d884c031e789b419b3b72;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/proto_http.c b/src/proto_http.c index 5ac9bf3cfe..aa8d9973e7 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;