]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http_fetch: Remove the version part when capturing the request uri
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 15 Nov 2018 13:35:18 +0000 (14:35 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Nov 2018 15:05:51 +0000 (16:05 +0100)
This patch fixes a bug introduced in the commit 6b952c810 ("REORG: http: move
http_get_path() to http.c"). In the reorg, the code responsible to skip the
version to only extract the path in the HTTP request was dropped.

No backport is needed, this only affects 1.9.

src/http_fetch.c

index 40381ccbc1e8c5048c03abbdbc6bdb246c1beaad..142bd35a58f745bcb7f38944d2b86cc3507c3e14 100644 (file)
@@ -1252,9 +1252,13 @@ static int smp_fetch_capture_req_uri(const struct arg *args, struct sample *smp,
        if (!*ptr)
                return 0;
 
-       ptr++;  /* skip the space */
+       /* skip the first space and find space after URI */
+       path = ist2(++ptr, 0);
+       while (*ptr != ' ' && *ptr != '\0')
+               ptr++;
+       path.len = ptr - path.ptr;
 
-       path = http_get_path(ist(ptr));
+       path = http_get_path(path);
        if (!path.ptr)
                return 0;