diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/taler-merchant-httpd.c | 4 | ||||
-rw-r--r-- | src/backend/taler-merchant-httpd_proposal.c | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 44937fdc..1eb39261 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -1052,7 +1052,9 @@ TMH_lookup_instance (const char *name) /** - * Extract merchant instance from the given JSON + * Extract merchant instance from the given JSON; if not + * 'instance' field was found, then "default" instance is + * returned. * * @param json the JSON to inspect; it is not required to * comply with any particular format. It will only be checked diff --git a/src/backend/taler-merchant-httpd_proposal.c b/src/backend/taler-merchant-httpd_proposal.c index 0ce99287..b2dc610f 100644 --- a/src/backend/taler-merchant-httpd_proposal.c +++ b/src/backend/taler-merchant-httpd_proposal.c @@ -447,6 +447,20 @@ proposal_put (struct MHD_Connection *connection, } mi = TMH_lookup_instance_json (merchant); + + /* The outer instance field, and the one included + * in the merchant object are different */ + if (0 != strcmp (mi->id, + instance)) + { + TALER_LOG_ERROR + ("Inconsistent instance specified by merchant\n"); + return TMH_RESPONSE_reply_not_found + (connection, + TALER_EC_CONTRACT_INSTANCE_INCONSISTENT, + "Inconsistent instance given"); + } + if (NULL == mi) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |