summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_private-post-webhooks.c
diff options
context:
space:
mode:
authorpriscilla <priscilla.huang@efrei.net>2023-01-30 09:50:43 -0500
committerpriscilla <priscilla.huang@efrei.net>2023-01-30 09:51:04 -0500
commit60e77f622c825b81e663f4b97af2a8f98ef995bb (patch)
treef23cb2c892c408c16dcf19e384aacc5b5da1759f /src/backend/taler-merchant-httpd_private-post-webhooks.c
parent7c7b7407afbf4f51d9c02479843257b50f398e42 (diff)
downloadmerchant-60e77f622c825b81e663f4b97af2a8f98ef995bb.tar.gz
merchant-60e77f622c825b81e663f4b97af2a8f98ef995bb.tar.bz2
merchant-60e77f622c825b81e663f4b97af2a8f98ef995bb.zip
testing pending webhook
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-post-webhooks.c')
-rw-r--r--src/backend/taler-merchant-httpd_private-post-webhooks.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/backend/taler-merchant-httpd_private-post-webhooks.c b/src/backend/taler-merchant-httpd_private-post-webhooks.c
index 48f6e7fb..794ede35 100644
--- a/src/backend/taler-merchant-httpd_private-post-webhooks.c
+++ b/src/backend/taler-merchant-httpd_private-post-webhooks.c
@@ -51,10 +51,18 @@ webhooks_equal (const struct TALER_MERCHANTDB_WebhookDetails *w1,
w2->url)) &&
(0 == strcmp (w1->http_method,
w2->http_method)) &&
- (0 == strcmp (w1->header_template,
- w2->header_template)) &&
- (0 == strcmp (w1->body_template,
- w2->body_template)));
+ ( ( (NULL == w1->header_template) &&
+ (NULL == w2->header_template) ) ||
+ ( (NULL != w1->header_template) &&
+ (NULL != w2->header_template) &&
+ (0 == strcmp (w1->header_template,
+ w2->header_template)) ) ) &&
+ ( ( (NULL == w1->body_template) &&
+ (NULL == w2->body_template) ) ||
+ ( (NULL != w1->body_template) &&
+ (NULL != w2->body_template) &&
+ (0 == strcmp (w1->body_template,
+ w2->body_template)) ) ) );
}
@@ -76,10 +84,14 @@ TMH_private_post_webhooks (const struct TMH_RequestHandler *rh,
(const char **) &wb.url),
GNUNET_JSON_spec_string ("http_method",
(const char **) &wb.http_method),
- GNUNET_JSON_spec_string ("header_template",
- (const char **) &wb.header_template),
- GNUNET_JSON_spec_string ("body_template",
- (const char **) &wb.body_template),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_string ("header_template",
+ (const char **) &wb.header_template),
+ NULL),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_string ("body_template",
+ (const char **) &wb.body_template),
+ NULL),
GNUNET_JSON_spec_end ()
};