commit 2caeb2c96c40984faa37f2264b1d1b070f4e61f8
parent a369995a792e3a9618c5c8f8e6b257f406df9f5f
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Sun, 16 Aug 2026 08:29:49 +0200
only add HTML content-thype if we actually succeeded with building HTML
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/templating/templating_api.c b/src/templating/templating_api.c
@@ -371,10 +371,13 @@ TALER_TEMPLATING_reply (struct MHD_Connection *connection,
&reply);
if (GNUNET_SYSERR == res)
return res;
- GNUNET_break (MHD_NO !=
- MHD_add_response_header (reply,
- MHD_HTTP_HEADER_CONTENT_TYPE,
- "text/html"));
+ if (GNUNET_OK == res)
+ GNUNET_break (MHD_NO !=
+ MHD_add_response_header (reply,
+ MHD_HTTP_HEADER_CONTENT_TYPE,
+ "text/html"));
+ /* Note: on failure, @a reply is a JSON error message
+ which already comes with its own content type. */
/* FIXME: also vary by compression? */
GNUNET_break (MHD_NO !=
MHD_add_response_header (