diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-11-21 20:53:46 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-11-21 20:53:53 +0100 |
commit | f1cc5beaf957ba7ae575ee4055700c699112c9e6 (patch) | |
tree | 2983462daef5b5ae8f81b3e396527058d7dd7b8e /src/backend/taler-merchant-httpd.c | |
parent | 923e2faef20ca34002170cf0f3b8e3890377c47e (diff) |
-fix spa redirect for instances
Diffstat (limited to 'src/backend/taler-merchant-httpd.c')
-rw-r--r-- | src/backend/taler-merchant-httpd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 9137c39b..64fa7005 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -602,6 +602,7 @@ spa_redirect (const struct TMH_RequestHandler *rh, { const char *text = "Redirecting to /webui/"; struct MHD_Response *response; + char *dst; response = MHD_create_response_from_buffer (strlen (text), (void *) text, @@ -616,6 +617,12 @@ spa_redirect (const struct TMH_RequestHandler *rh, MHD_add_response_header (response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/plain")); + if (NULL == hc->instance) + dst = GNUNET_strdup ("/webui/"); + else + GNUNET_asprintf (&dst, + "/instances/%s/webui/", + hc->instance->settings.id); if (MHD_NO == MHD_add_response_header (response, MHD_HTTP_HEADER_LOCATION, @@ -623,8 +630,10 @@ spa_redirect (const struct TMH_RequestHandler *rh, { GNUNET_break (0); MHD_destroy_response (response); + GNUNET_free (dst); return MHD_NO; } + GNUNET_free (dst); { MHD_RESULT ret; |