summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-05 21:47:18 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-05 21:47:18 +0100
commit53767a09fc38120b25d6e4302d476fd5364474e6 (patch)
tree5af3705b5dac389ab7a42bc90b7f3854517d4362
parent2300a850fe3bcf0176ff77f51cf0cb699bc9a79e (diff)
downloadsync-53767a09fc38120b25d6e4302d476fd5364474e6.tar.gz
sync-53767a09fc38120b25d6e4302d476fd5364474e6.tar.bz2
sync-53767a09fc38120b25d6e4302d476fd5364474e6.zip
use If-none-match instead of etag
-rw-r--r--src/lib/sync_api_upload.c5
-rw-r--r--src/sync/sync-httpd_backup_post.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/sync_api_upload.c b/src/lib/sync_api_upload.c
index 31a7d08..97811e8 100644
--- 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
index 251dc10..cdec9fd 100644
--- 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 */