commit 88ce3c98456dc44cec796883c996411795ed58c1
parent 102ef2570750a3969cb7147df167352ef5fb3c48
Author: Florian Dold <dold@taler.net>
Date: Tue, 28 Jul 2026 16:46:18 +0200
paivana: answer HEAD requests for the paywall page
Only GET was dispatched to the template handler, so a HEAD fell through to
the paywall check and was redirected to the paywall URL it was already
requesting, forever.
Issue: https://bugs.taler.net/n/11640
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/backend/paivana-httpd_daemon.c b/src/backend/paivana-httpd_daemon.c
@@ -168,8 +168,13 @@ create_response (void *cls,
if ( (0 == strncmp (url,
"/.well-known/paivana/templates/",
strlen ("/.well-known/paivana/templates/"))) &&
- (0 == strcasecmp (meth,
- MHD_HTTP_METHOD_GET)) )
+ ( (0 == strcasecmp (meth,
+ MHD_HTTP_METHOD_GET)) ||
+ /* HEAD must be answered like GET (MHD suppresses the body);
+ otherwise it falls through to the paywall check below,
+ which redirects to this very URL again -- forever. */
+ (0 == strcasecmp (meth,
+ MHD_HTTP_METHOD_HEAD)) ) )
{
const char *id = &url[strlen ("/.well-known/paivana/templates/")];