From a9ae2171b897dfc9635e9ab72a04d65379bf2208 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 16 Jan 2020 21:57:40 +0100 Subject: reuse TALER_url_join --- src/lib/auditor_api_handle.c | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'src/lib/auditor_api_handle.c') diff --git a/src/lib/auditor_api_handle.c b/src/lib/auditor_api_handle.c index f1df204cb..aa0489a30 100644 --- a/src/lib/auditor_api_handle.c +++ b/src/lib/auditor_api_handle.c @@ -405,34 +405,13 @@ char * MAH_path_to_url (struct TALER_AUDITOR_Handle *h, const char *path) { - return MAH_path_to_url2 (h->url, - path); -} - - -/** - * Obtain the URL to use for an API request. - * FIXME: duplicates TEAH_path_to_url2, and likely also logic in util! - * - * @param base_url base URL of the auditor (i.e. "http://auditor/") - * @param path Taler API path (i.e. "/deposit-confirmation") - * @return the full URL to use with cURL - */ -char * -MAH_path_to_url2 (const char *base_url, - const char *path) -{ - char *url; - - if ( ('/' == path[0]) && - (0 < strlen (base_url)) && - ('/' == base_url[strlen (base_url) - 1]) ) - path++; /* avoid generating URL with "//" from concat */ - GNUNET_asprintf (&url, - "%s%s", - base_url, - path); - return url; + char *ret; + GNUNET_assert ('/' == path[0]); + ret = TALER_url_join (h->url, + path + 1, + NULL); + GNUNET_assert (NULL != ret); + return ret; } -- cgit v1.2.3