[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 03/03: -check for ETag in request, generate 304 if appl
From: |
gnunet |
Subject: |
[taler-exchange] 03/03: -check for ETag in request, generate 304 if applicable |
Date: |
Tue, 17 May 2022 14:53:02 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit a6b21080099a4b6777749759238464f87f7d013c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue May 17 14:39:52 2022 +0200
-check for ETag in request, generate 304 if applicable
---
src/exchange/taler-exchange-httpd_keys.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/exchange/taler-exchange-httpd_keys.c
b/src/exchange/taler-exchange-httpd_keys.c
index 5a6a506e..0fde1d67 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -2854,7 +2854,11 @@ TEH_keys_get_handler (struct TEH_RequestContext *rc,
const char *const args[])
{
struct GNUNET_TIME_Timestamp last_issue_date;
+ const char *etag;
+ etag = MHD_lookup_connection_value (rc->connection,
+ MHD_HEADER_KIND,
+ MHD_HTTP_HEADER_IF_NONE_MATCH);
(void) args;
{
const char *have_cherrypick;
@@ -2935,6 +2939,31 @@ TEH_keys_get_handler (struct TEH_RequestContext *rc,
Wait until they are. */
return suspend_request (rc->connection);
}
+ if ( (NULL != etag) &&
+ (0 == strcmp (etag,
+ krd->etag)) )
+ {
+ MHD_RESULT ret;
+ struct MHD_Response *resp;
+
+ resp = MHD_create_response_from_buffer (0,
+ NULL,
+ MHD_RESPMEM_PERSISTENT);
+ TALER_MHD_add_global_headers (resp);
+ GNUNET_break (GNUNET_OK ==
+ setup_general_response_headers (ksh,
+ resp));
+ GNUNET_break (MHD_YES ==
+ MHD_add_response_header (resp,
+ MHD_HTTP_HEADER_ETAG,
+ krd->etag));
+ ret = MHD_queue_response (rc->connection,
+ MHD_HTTP_NOT_MODIFIED,
+ resp);
+ GNUNET_break (MHD_YES == ret);
+ MHD_destroy_response (resp);
+ return ret;
+ }
return MHD_queue_response (rc->connection,
MHD_HTTP_OK,
(MHD_YES ==
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.