]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http_fetch: Add support for empty delim in url_param
authorMartin DOLEZ <martin@dolez.fr>
Tue, 28 Mar 2023 13:49:53 +0000 (09:49 -0400)
committerWilly Tarreau <w@1wt.eu>
Thu, 30 Mar 2023 12:10:59 +0000 (14:10 +0200)
In prevision of adding a third parameter to the url_param
sample-fetch function we need to make the second parameter optional.
User can now pass a empty 2nd argument to keep the default delimiter.

src/http_fetch.c

index f855a675fa4ac4cbff321d02cf696cadb251dec2..732cfbbb14e8ff49b886a74d3cf46192def55ad7 100644 (file)
@@ -1902,7 +1902,7 @@ static int smp_fetch_url_param(const struct arg *args, struct sample *smp, const
                name_len = args->data.str.data;
        }
 
-       if (args[1].type)
+       if (args[1].type && *args[1].data.str.area)
                delim = *args[1].data.str.area;
 
        if (!smp->ctx.a[0]) { // first call, find the query string