diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-04-06 20:11:15 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-04-06 20:11:15 +0200 |
commit | 1e10f069f6e808929386113fef992ded67d43d88 (patch) | |
tree | f18ddc213dd482d226f13b5d850126493908d64a | |
parent | 198a7d598407e90f134c438ead682a868347d072 (diff) |
fix #6833
-rw-r--r-- | src/backend/taler-merchant-httpd.c | 10 | ||||
-rw-r--r-- | src/testing/test_merchant_api.c | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 611be6bf..0878b265 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -1839,6 +1839,16 @@ url_handler (void *cls, /* At this point, we must have found a handler */ GNUNET_assert (NULL != hc->rh); + /* If an instance should be there, check one exists */ + if ( (NULL == hc->instance) && + (! hc->rh->skip_instance) ) + { + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_NOT_FOUND, + TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN, + hc->infix); + } + /* Access control for private handlers */ if (use_private) { diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 8b5c46bc..401cfd0a 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -1312,10 +1312,10 @@ run (void *cls, "i2", MHD_HTTP_NOT_FOUND, NULL), - TALER_TESTING_cmd_merchant_purge_instance ("instance-delete-i2-again", + TALER_TESTING_cmd_merchant_purge_instance ("instance-delete-then-purge-i2", merchant_url, "i2", - MHD_HTTP_NOT_FOUND), + MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_merchant_post_instances ("instance-create-default", merchant_url, "default", @@ -1438,7 +1438,7 @@ run (void *cls, merchant_url, "i1", MHD_HTTP_NO_CONTENT), - TALER_TESTING_cmd_merchant_delete_instance ("instance-delete-i1-again", + TALER_TESTING_cmd_merchant_delete_instance ("instance-purge-then-delete-i1", merchant_url, "i1", MHD_HTTP_NOT_FOUND), |