summaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-05-16 16:58:09 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2019-05-16 16:58:09 +0200
commit95933156a6d477460a20225209f556208702d55e (patch)
treee9f940ba5adfe136f1e27aa77ddc1860ff526cfd /src/bank-lib
parent8d34b22aff354f02bbd161a4e51fc8b878e32ff9 (diff)
downloadexchange-95933156a6d477460a20225209f556208702d55e.tar.gz
exchange-95933156a6d477460a20225209f556208702d55e.tar.bz2
exchange-95933156a6d477460a20225209f556208702d55e.zip
Fix compression.
The "Content-Encoding: deflate" header is now added from within the compression routine itself, and _not_ from the "exchange handle". This fixed the bank-lib functions as those do not use any exchange handle, and therefore were wrongly sending compressed bodies without adding the mentioned HTTP header.
Diffstat (limited to 'src/bank-lib')
-rw-r--r--src/bank-lib/bank_api_admin.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index b04d3e9a7..0d07be964 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -189,7 +189,6 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
struct TALER_BANK_AdminAddIncomingHandle *aai;
json_t *admin_obj;
CURL *eh;
- struct curl_slist *headers = NULL;
if (NULL == exchange_base_url)
{
@@ -213,11 +212,13 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
aai->cb_cls = res_cb_cls;
aai->request_url = TALER_BANK_path_to_url_ (bank_base_url,
"/admin/add/incoming");
- headers = TALER_BANK_make_auth_header_ (auth);
+ aai->post_ctx.headers = TALER_BANK_make_auth_header_ (auth);
+
+ GNUNET_assert
+ (NULL != (aai->post_ctx.headers = curl_slist_append
+ (aai->post_ctx.headers,
+ "Content-Type: application/json")));
- GNUNET_assert (NULL !=
- (headers = curl_slist_append (headers,
- "Content-Type: application/json")));
eh = curl_easy_init ();
GNUNET_assert (GNUNET_OK ==
@@ -232,7 +233,7 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
aai->job = GNUNET_CURL_job_add2 (ctx,
eh,
- headers,
+ aai->post_ctx.headers,
&handle_admin_add_incoming_finished,
aai);
return aai;