diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-06-25 12:35:57 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-06-25 12:35:57 +0200 |
commit | 2563686e6645024af62706014be11879d4122599 (patch) | |
tree | a6fd250b9d42c294580c3b93074d221da82c7475 /src/lib/merchant_api_history.c | |
parent | 633a9b641ec7bbd4a60bb97a335808d212a7ceb9 (diff) | |
download | merchant-2563686e6645024af62706014be11879d4122599.tar.gz merchant-2563686e6645024af62706014be11879d4122599.tar.bz2 merchant-2563686e6645024af62706014be11879d4122599.zip |
handle '/' at end of URLs when composing http requests in libtalermerchant
Diffstat (limited to 'src/lib/merchant_api_history.c')
-rw-r--r-- | src/lib/merchant_api_history.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/merchant_api_history.c b/src/lib/merchant_api_history.c index c002d0a2..efc20be1 100644 --- a/src/lib/merchant_api_history.c +++ b/src/lib/merchant_api_history.c @@ -27,6 +27,7 @@ #include <gnunet/gnunet_curl_lib.h> #include "taler_merchant_service.h" #include <taler/taler_json_lib.h> +#include "merchant_api_common.h" /** @@ -159,21 +160,23 @@ TALER_MERCHANT_history (struct GNUNET_CURL_Context *ctx, struct TALER_MERCHANT_HistoryOperation *ho; uint64_t seconds; CURL *eh; + char *base; ho = GNUNET_new (struct TALER_MERCHANT_HistoryOperation); ho->ctx = ctx; ho->cb = history_cb; ho->cb_cls = history_cb_cls; seconds = date.abs_value_us / 1000LL / 1000LL; - + base = MAH_path_to_url_ (backend_uri, + "/history"); GNUNET_asprintf (&ho->url, - "%s/history?date=%llu&instance=%s&start=%d&delta=%d", - backend_uri, + "%s?date=%llu&instance=%s&start=%d&delta=%d", + base, seconds, instance, start, delta); - + GNUNET_free (base); eh = curl_easy_init (); if (CURLE_OK != curl_easy_setopt (eh, CURLOPT_URL, |