commit 53767a09fc38120b25d6e4302d476fd5364474e6
parent 2300a850fe3bcf0176ff77f51cf0cb699bc9a79e
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 5 Dec 2019 21:47:18 +0100
use If-none-match instead of etag
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/lib/sync_api_upload.c b/src/lib/sync_api_upload.c
@@ -326,11 +326,12 @@ SYNC_upload (struct GNUNET_CURL_Context *ctx,
}
job_headers = ext;
- /* set Etag header */
+ /* set If-None-Match header */
val = GNUNET_STRINGS_data_to_string_alloc (&usp.new_backup_hash,
sizeof (struct GNUNET_HashCode));
GNUNET_asprintf (&hdr,
- "Etag: %s",
+ "%s: %s",
+ MHD_HTTP_HEADER_IF_NONE_MATCH,
val);
GNUNET_free (val);
ext = curl_slist_append (job_headers,
diff --git a/src/sync/sync-httpd_backup_post.c b/src/sync/sync-httpd_backup_post.c
@@ -707,7 +707,7 @@ SH_backup_post (struct MHD_Connection *connection,
etag = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
- MHD_HTTP_HEADER_ETAG);
+ MHD_HTTP_HEADER_IF_NONE_MATCH);
if ( (NULL == etag) ||
(GNUNET_OK !=
GNUNET_STRINGS_string_to_data (etag,
@@ -718,8 +718,8 @@ SH_backup_post (struct MHD_Connection *connection,
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_BAD_REQUEST,
- TALER_EC_SYNC_BAD_ETAG,
- "Etag does not include not a base32-encoded SHA-512 hash");
+ TALER_EC_SYNC_BAD_IF_NONE_MATCH,
+ "If-none-match does not include not a base32-encoded SHA-512 hash");
}
}
/* validate signature */