fix missing auth header for /admin/add/incoming

This commit is contained in:
Christian Grothoff 2017-05-09 22:25:53 +02:00
parent e6d09d2568
commit 1edf34e52a
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -199,6 +199,18 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
aai->request_url = TALER_BANK_path_to_url_ (bank_base_url, aai->request_url = TALER_BANK_path_to_url_ (bank_base_url,
"/admin/add/incoming"); "/admin/add/incoming");
aai->authh = TALER_BANK_make_auth_header_ (auth); aai->authh = TALER_BANK_make_auth_header_ (auth);
/* Append content type header here, can't do it in GNUNET_CURL_job_add
as that would override the CURLOPT_HTTPHEADER instead of appending. */
{
struct curl_slist *ext;
ext = curl_slist_append (aai->authh,
"Content-Type: application/json");
if (NULL == ext)
GNUNET_break (0);
else
aai->authh = ext;
}
eh = curl_easy_init (); eh = curl_easy_init ();
GNUNET_assert (NULL != (aai->json_enc = GNUNET_assert (NULL != (aai->json_enc =
json_dumps (admin_obj, json_dumps (admin_obj,
@ -222,7 +234,7 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
strlen (aai->json_enc))); strlen (aai->json_enc)));
aai->job = GNUNET_CURL_job_add (ctx, aai->job = GNUNET_CURL_job_add (ctx,
eh, eh,
GNUNET_YES, GNUNET_NO,
&handle_admin_add_incoming_finished, &handle_admin_add_incoming_finished,
aai); aai);
return aai; return aai;