diff options
Diffstat (limited to 'src/lib/merchant_api_post_instance_auth.c')
-rw-r--r-- | src/lib/merchant_api_post_instance_auth.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/merchant_api_post_instance_auth.c b/src/lib/merchant_api_post_instance_auth.c index d16bd2cd..a659ffb5 100644 --- a/src/lib/merchant_api_post_instance_auth.c +++ b/src/lib/merchant_api_post_instance_auth.c @@ -97,6 +97,12 @@ handle_post_instance_auth_finished (void *cls, { case MHD_HTTP_NO_CONTENT: break; + case MHD_HTTP_BAD_REQUEST: + /* happens if the auth token is malformed */ + hr.ec = TALER_JSON_get_error_code (json); + hr.hint = TALER_JSON_get_error_hint (json); + /* Nothing really to verify, merchant says we need to authenticate. */ + break; case MHD_HTTP_UNAUTHORIZED: hr.ec = TALER_JSON_get_error_code (json); hr.hint = TALER_JSON_get_error_hint (json); @@ -139,7 +145,7 @@ TALER_MERCHANT_instance_auth_post ( char *path; GNUNET_asprintf (&path, - "instances/%s/private/auth", + "private/instances/%s/auth", instance_id); iaph->url = TALER_url_join (backend_url, path, @@ -150,7 +156,7 @@ TALER_MERCHANT_instance_auth_post ( { /* backend_url is already identifying the instance */ iaph->url = TALER_url_join (backend_url, - "/private/auth", + "private/auth", NULL); } if (NULL == iaph->url) @@ -208,10 +214,11 @@ TALER_MERCHANT_instance_auth_post ( curl_easy_setopt (eh, CURLOPT_CUSTOMREQUEST, MHD_HTTP_METHOD_POST)); - iaph->job = GNUNET_CURL_job_add (ctx, - eh, - &handle_post_instance_auth_finished, - iaph); + iaph->job = GNUNET_CURL_job_add2 (ctx, + eh, + iaph->post_ctx.headers, + &handle_post_instance_auth_finished, + iaph); } return iaph; } |