diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-04-21 10:27:13 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-04-21 10:27:19 +0200 |
commit | 2fd5de69580da71cc10bf9f2d11dbf6023010f53 (patch) | |
tree | a5dfb191ca5e0aecc31b10ba16ea386ac917cd62 | |
parent | cf833bad50ed4a74c07242557e9b07fe8723d7fc (diff) |
fix cache control for /config: rebuild response after it expired
-rw-r--r-- | src/exchange/taler-exchange-httpd_config.c | 12 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_config.h | 2 |
2 files changed, 11 insertions, 3 deletions
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)); diff --git a/src/exchange/taler-exchange-httpd_config.h b/src/exchange/taler-exchange-httpd_config.h index c0a14104a..068f51d41 100644 --- a/src/exchange/taler-exchange-httpd_config.h +++ b/src/exchange/taler-exchange-httpd_config.h @@ -41,7 +41,7 @@ * * Returned via both /config and /keys endpoints. */ -#define EXCHANGE_PROTOCOL_VERSION "19:1:2" +#define EXCHANGE_PROTOCOL_VERSION "19:2:2" /** |