From: Thierry FOURNIER Date: Sun, 26 Apr 2015 16:01:40 +0000 (+0200) Subject: BUG/MEDIUM: http: functions set-{path,query,method,uri} breaks the HTTP parser X-Git-Tag: v1.6-dev2~182 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f6192c0d313d6ae28096f606c701ff212687f8c;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: http: functions set-{path,query,method,uri} breaks the HTTP parser When one of these functions replaces a part of the query string by a shorter or longer new one, the header parsing is broken. This is because the start of the first header is not updated. In the same way, the total length of the request line is not updated. I dont see any bug caused by this miss, but I guess than it is better to store the good length. This bug is only in the development version. --- diff --git a/src/proto_http.c b/src/proto_http.c index d20225a921..6bb0745eec 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -11825,6 +11825,8 @@ int http_replace_req_line(int action, const char *replace, int len, /* commit changes and adjust end of message */ delta = buffer_replace2(s->req.buf, cur_ptr, cur_end, replace + offset, len - offset); + txn->req.sl.rq.l += delta; + txn->hdr_idx.v[0].len += delta; http_msg_move_end(&txn->req, delta); return 0; }