aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3_get.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-26 20:39:32 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-26 20:39:32 +0000
commit81ecc4999e16c58ce6d0e97501f7b6b1497f6cf6 (patch)
treed22638738b6105ebc8c7eb8fe1d633bf3627b034 /src/api/s3_get.rs
parent1999c0ae5152917625558c588e71b27f63950f41 (diff)
downloadgarage-81ecc4999e16c58ce6d0e97501f7b6b1497f6cf6.tar.gz
garage-81ecc4999e16c58ce6d0e97501f7b6b1497f6cf6.zip
Implement multipart uploads
Diffstat (limited to 'src/api/s3_get.rs')
-rw-r--r--src/api/s3_get.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/s3_get.rs b/src/api/s3_get.rs
index dbdac03c..75478e46 100644
--- a/src/api/s3_get.rs
+++ b/src/api/s3_get.rs
@@ -12,7 +12,6 @@ use garage_table::EmptyKey;
use garage_core::garage::Garage;
use garage_core::object_table::*;
-use crate::api_server::BodyType;
use crate::http_util::*;
fn object_headers(version: &ObjectVersion) -> http::response::Builder {
@@ -86,6 +85,9 @@ pub async fn handle_get(
let resp_builder = object_headers(&last_v).status(StatusCode::OK);
match &last_v.data {
+ ObjectVersionData::Uploading => Err(Error::Message(format!(
+ "Version is_complete() but data is stil Uploading (internal error)"
+ ))),
ObjectVersionData::DeleteMarker => Err(Error::NotFound),
ObjectVersionData::Inline(bytes) => {
let body: BodyType = Box::new(BytesBody::from(bytes.to_vec()));