From 2fd5de69580da71cc10bf9f2d11dbf6023010f53 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 21 Apr 2024 10:27:13 +0200 Subject: fix cache control for /config: rebuild response after it expired --- src/exchange/taler-exchange-httpd_config.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_config.c') diff --git a/src/exchange/taler-exchange-httpd_config.c b/src/exchange/taler-exchange-httpd_config.c index e17a9a050..257dfa6ba 100644 --- a/src/exchange/taler-exchange-httpd_config.c +++ b/src/exchange/taler-exchange-httpd_config.c @@ -33,10 +33,17 @@ TEH_handler_config (struct TEH_RequestContext *rc, const char *const args[]) { static struct MHD_Response *resp; + static struct GNUNET_TIME_Absolute a; + (void) args; + if ( (GNUNET_TIME_absolute_is_past (a)) && + (NULL != resp) ) + { + MHD_destroy_response (resp); + resp = NULL; + } if (NULL == resp) { - struct GNUNET_TIME_Absolute a; struct GNUNET_TIME_Timestamp km; char dat[128]; @@ -62,7 +69,8 @@ TEH_handler_config (struct TEH_RequestContext *rc, GNUNET_JSON_pack_string ("name", "taler-exchange"), GNUNET_JSON_pack_string ("implementation", - "urn:net:taler:specs:taler-exchange:c-reference"), + "urn:net:taler:specs:taler-exchange:c-reference") + , GNUNET_JSON_pack_string ("version", EXCHANGE_PROTOCOL_VERSION)); -- cgit v1.2.3