Le 15/11/2018 à 11:14, Dave Cottlehuber a écrit :
bonjour list,
In comparison to 1.8 (and probably 1.9b5 but I can't verify that at present)
the 301 redirect seems to be handled differently. Initially I thought this was
an HTTP2 issue but it 's reproducible on HTTP/1.1 as well.
Hi Dave,
A bug was introduced in the commit 6b952c810 in the way the request's
uri is captured. So it exists since the 1.9-dev2. Could you test the
attached patch to confirm the fix ?
Thanks !
--
Christopher Faulet
>From 40c8c8bdbb73b41911fcf7e8fd2d7c9ac2d787e2 Mon Sep 17 00:00:00 2001
From: Christopher Faulet <[email protected]>
Date: Thu, 15 Nov 2018 14:35:18 +0100
Subject: [PATCH] BUG/MINOR: http_fetch: Remove the version part when capturing
the request uri
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 | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/http_fetch.c b/src/http_fetch.c
index 40381ccbc..142bd35a5 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -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;
--
2.17.2