From 5e859bae099245af0b9a95b6c45059863153b95f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 23 Sep 2019 17:23:54 +0200 Subject: make URL joining more restrictive to avoid mistakes --- src/util/test_url.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/util/test_url.c') diff --git a/src/util/test_url.c b/src/util/test_url.c index 59a5e3fa..f6aab0dc 100644 --- a/src/util/test_url.c +++ b/src/util/test_url.c @@ -51,12 +51,8 @@ main (int argc, cf (TALER_url_join ("https://taler.net/", "foo", NULL), "https://taler.net/foo"); - cf (TALER_url_join ("https://taler.net", "foo", NULL), - "https://taler.net/foo"); - cf (TALER_url_join ("https://taler.net/", "/foo", NULL), + cf (TALER_url_join ("https://taler.net/", "foo", NULL), "https://taler.net/foo"); - cf (TALER_url_join ("https://taler.net/", "/foo/", NULL), - "https://taler.net/foo/"); cf (TALER_url_join ("https://taler.net/", "foo", "x", "42", NULL), "https://taler.net/foo?x=42"); @@ -67,11 +63,11 @@ main (int argc, cf (TALER_url_join ("https://taler.net/", "foo", "x", "", "y", "1", NULL), "https://taler.net/foo?x=&y=1"); - cf (TALER_url_join ("https://taler.net", "foo/bar", "x", "a&b", NULL), + cf (TALER_url_join ("https://taler.net/", "foo/bar", "x", "a&b", NULL), "https://taler.net/foo/bar?x=a%26b"); /* Path component is not encoded! */ - cf (TALER_url_join ("https://taler.net", "foo/bar?spam=eggs&quux=", NULL), + cf (TALER_url_join ("https://taler.net/", "foo/bar?spam=eggs&quux=", NULL), "https://taler.net/foo/bar?spam=eggs&quux="); cf (TALER_url_absolute_raw ("https", "taler.net", "foo/bar", "baz", -- cgit v1.2.3