summaryrefslogtreecommitdiff
path: root/src/lib/auditor_api_handle.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-16 21:57:40 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-16 21:57:40 +0100
commita9ae2171b897dfc9635e9ab72a04d65379bf2208 (patch)
tree11d67216d1c5594a4048d333b56ac40b4cf0acd1 /src/lib/auditor_api_handle.c
parentdd6bad739a7b7539952af6bebb74bfe3ffa0f9d7 (diff)
downloadexchange-a9ae2171b897dfc9635e9ab72a04d65379bf2208.tar.gz
exchange-a9ae2171b897dfc9635e9ab72a04d65379bf2208.tar.bz2
exchange-a9ae2171b897dfc9635e9ab72a04d65379bf2208.zip
reuse TALER_url_join
Diffstat (limited to 'src/lib/auditor_api_handle.c')
-rw-r--r--src/lib/auditor_api_handle.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/src/lib/auditor_api_handle.c b/src/lib/auditor_api_handle.c
index f1df204c..aa0489a3 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;
}