merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit b5260e975b225731b50787c2aca986a5898b8f14
parent 5c3299e4ecc82fa58b7014da8e8899d2c295bf42
Author: Florian Dold <dold@taler.net>
Date:   Fri, 31 Jul 2026 15:44:11 +0200

merchant: match the instance name case-insensitively on the deprecated path

'/instances/Admin/' missed the redirect to the modern path, so use_admin
stayed false and every 'default_only' handler, i.e. all of /management/,
replied 404 where '/instances/admin/' works.

Diffstat:
Msrc/backend/taler-merchant-httpd.c | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c @@ -557,13 +557,21 @@ identify_instance (struct TMH_HandlerContext *hc, /* url starts with "/instances/" */ const char *istart = url + strlen (instance_prefix); const char *slash = strchr (istart, '/'); + char *raw_id; char *instance_id; if (NULL == slash) - instance_id = GNUNET_strdup (istart); + raw_id = GNUNET_strdup (istart); else - instance_id = GNUNET_strndup (istart, - slash - istart); + raw_id = GNUNET_strndup (istart, + slash - istart); + /* Instance IDs are case-insensitive, so fold the segment before comparing + it against "admin" below. Without this, '/instances/Admin/' misses the + redirect to the modern path, leaving use_admin false, and every + 'default_only' handler that '/instances/admin/' reaches (all of + /management/) then replies 404. */ + instance_id = GNUNET_STRINGS_utf8_tolower (raw_id); + GNUNET_free (raw_id); if (0 == strcmp (instance_id, "admin")) {