From 7f6192c0d313d6ae28096f606c701ff212687f8c Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Sun, 26 Apr 2015 18:01:40 +0200 Subject: [PATCH] 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. --- src/proto_http.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.47.3