summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_kyc-proof.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-05-04 14:42:06 +0200
committerChristian Grothoff <christian@grothoff.org>2023-05-04 14:42:06 +0200
commit4c1a2c030761fc64773d035df6cdd01db0204d13 (patch)
tree6bc7273259fc4738c5522313ee5338565e45cd50 /src/exchange/taler-exchange-httpd_kyc-proof.c
parent0b8752bb1b0f61e9d140e4d89a612ddea01c56e2 (diff)
downloadexchange-4c1a2c030761fc64773d035df6cdd01db0204d13.tar.gz
exchange-4c1a2c030761fc64773d035df6cdd01db0204d13.tar.bz2
exchange-4c1a2c030761fc64773d035df6cdd01db0204d13.zip
more shared logic for argument/header parsing
Diffstat (limited to 'src/exchange/taler-exchange-httpd_kyc-proof.c')
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-proof.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-proof.c b/src/exchange/taler-exchange-httpd_kyc-proof.c
index 6d06f0c82..9668ee54c 100644
--- a/src/exchange/taler-exchange-httpd_kyc-proof.c
+++ b/src/exchange/taler-exchange-httpd_kyc-proof.c
@@ -297,7 +297,6 @@ TEH_handler_kyc_proof (
{
struct KycProofContext *kpc = rc->rh_ctx;
const char *provider_section_or_logic = args[0];
- const char *h_payto;
if (NULL == kpc)
{
@@ -310,33 +309,13 @@ TEH_handler_kyc_proof (
TALER_EC_GENERIC_ENDPOINT_UNKNOWN,
"'/kyc-proof/$PROVIDER_SECTION?state=$H_PAYTO' required");
}
- h_payto = MHD_lookup_connection_value (rc->connection,
- MHD_GET_ARGUMENT_KIND,
- "state");
- if (NULL == h_payto)
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MISSING,
- "h_payto");
- }
kpc = GNUNET_new (struct KycProofContext);
kpc->rc = rc;
rc->rh_ctx = kpc;
rc->rh_cleaner = &clean_kpc;
- if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (h_payto,
- strlen (h_payto),
- &kpc->h_payto,
- sizeof (kpc->h_payto)))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "h_payto");
- }
+ TALER_MHD_parse_request_arg_auto_t (rc->connection,
+ "state",
+ &kpc->h_payto);
if (GNUNET_OK !=
TALER_KYCLOGIC_lookup_logic (provider_section_or_logic,
&kpc->logic,