aboutsummaryrefslogtreecommitdiff
path: root/src/api/k2v
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2022-10-18 14:20:44 +0000
committerAlex <alex@adnab.me>2022-10-18 14:20:44 +0000
commit5670599372f6c3c60dcd74279a0741248fc510c3 (patch)
tree2852a5e3cf2a0d1728b7d67e59e1b13aaae92287 /src/api/k2v
parent7bc9fd34b250384d1b80ed28dc6c9e6abcda69ae (diff)
parentf1c96d108c29ae4ef7b1f7ed8f2c06b6a5744909 (diff)
downloadgarage-5670599372f6c3c60dcd74279a0741248fc510c3.tar.gz
garage-5670599372f6c3c60dcd74279a0741248fc510c3.zip
Merge pull request 'Use status code 204 No Content for empty responses' (#403) from tobikris/garage:http-no-content into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/403
Diffstat (limited to 'src/api/k2v')
-rw-r--r--src/api/k2v/batch.rs2
-rw-r--r--src/api/k2v/item.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/api/k2v/batch.rs b/src/api/k2v/batch.rs
index db9901cf..78035362 100644
--- a/src/api/k2v/batch.rs
+++ b/src/api/k2v/batch.rs
@@ -42,7 +42,7 @@ pub async fn handle_insert_batch(
garage.k2v.rpc.insert_batch(bucket_id, items2).await?;
Ok(Response::builder()
- .status(StatusCode::OK)
+ .status(StatusCode::NO_CONTENT)
.body(Body::empty())?)
}
diff --git a/src/api/k2v/item.rs b/src/api/k2v/item.rs
index 836d386f..f85138c7 100644
--- a/src/api/k2v/item.rs
+++ b/src/api/k2v/item.rs
@@ -153,7 +153,7 @@ pub async fn handle_insert_item(
.await?;
Ok(Response::builder()
- .status(StatusCode::OK)
+ .status(StatusCode::NO_CONTENT)
.body(Body::empty())?)
}