commit 898aad8e85efa9fcb3d7f33f305fae8ad4ef5ce4
parent ff6245a43326a5cc40ef17627b2068da431d6eb9
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Mon, 26 Jan 2026 03:47:30 +0100
etags must be quoted
Diffstat:
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
@@ -447,8 +447,11 @@ resume_kyc_with_response (struct KycContext *kc)
MHD_GET_ARGUMENT_KIND,
MHD_HTTP_HEADER_IF_NONE_MATCH);
if ( (NULL == inm) ||
- (0 != strcmp (inm,
- can)) )
+ ('"' != inm[0]) ||
+ ('"' != inm[strlen (inm) - 1]) ||
+ (0 != strncmp (inm + 1,
+ can,
+ strlen (can))) )
not_modified = false; /* must return full response */
}
GNUNET_free (can);
@@ -460,13 +463,18 @@ resume_kyc_with_response (struct KycContext *kc)
kc->kycs_data));
{
char *etag;
+ char *qetag;
etag = GNUNET_STRINGS_data_to_string_alloc (&sh,
sizeof (sh));
+ GNUNET_asprintf (&qetag,
+ "\"%s\"",
+ etag);
GNUNET_break (MHD_YES ==
MHD_add_response_header (kc->response,
MHD_HTTP_HEADER_ETAG,
- etag));
+ qetag));
+ GNUNET_free (qetag);
GNUNET_free (etag);
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c
@@ -912,8 +912,11 @@ check_reply (struct GetOrderRequestContext *gorc,
MHD_GET_ARGUMENT_KIND,
MHD_HTTP_HEADER_IF_NONE_MATCH);
if ( (NULL == inm) ||
- (0 != strcmp (inm,
- can)) )
+ ('"' != inm[0]) ||
+ ('"' != inm[strlen (inm) - 1]) ||
+ (0 != strncmp (inm + 1,
+ can,
+ strlen (can))) )
not_modified = false; /* must return full response */
}
GNUNET_free (can);
@@ -923,13 +926,18 @@ check_reply (struct GetOrderRequestContext *gorc,
response = TALER_MHD_make_json (reply);
{
char *etag;
+ char *qetag;
etag = GNUNET_STRINGS_data_to_string_alloc (&sh,
sizeof (sh));
+ GNUNET_asprintf (&qetag,
+ "\"%s\"",
+ etag);
GNUNET_break (MHD_YES ==
MHD_add_response_header (response,
MHD_HTTP_HEADER_ETAG,
- etag));
+ qetag));
+ GNUNET_free (qetag);
GNUNET_free (etag);
}