aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/multipart.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-10-20 13:37:37 +0200
committerAlex Auvolat <alex@adnab.me>2023-10-20 13:37:37 +0200
commit8686cfd0b10a49048021102a08d637b0d4fe6a91 (patch)
tree1a7d54429686d45d89978f788e5cdb5e8d7805a6 /src/api/s3/multipart.rs
parentc6cde1f1437a6cab90b22df6fe0641e5ad34c287 (diff)
downloadgarage-8686cfd0b10a49048021102a08d637b0d4fe6a91.tar.gz
garage-8686cfd0b10a49048021102a08d637b0d4fe6a91.zip
s3 api: also ensure increasing timestamps for create_multipart_upload
Diffstat (limited to 'src/api/s3/multipart.rs')
-rw-r--r--src/api/s3/multipart.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/s3/multipart.rs b/src/api/s3/multipart.rs
index 672ab198..aaf271ab 100644
--- a/src/api/s3/multipart.rs
+++ b/src/api/s3/multipart.rs
@@ -30,10 +30,13 @@ pub async fn handle_create_multipart_upload(
req: &Request<Body>,
bucket_name: &str,
bucket_id: Uuid,
- key: &str,
+ key: &String,
) -> Result<Response<Body>, Error> {
+ let existing_object = garage.object_table.get(&bucket_id, &key).await?;
+
let upload_id = gen_uuid();
- let timestamp = now_msec();
+ let timestamp = next_timestamp(&existing_object);
+
let headers = get_headers(req.headers())?;
// Create object in object table