aboutsummaryrefslogtreecommitdiff
path: root/src/api/api_server.rs
diff options
context:
space:
mode:
authortrinity-1686a <trinity.pointard@gmail.com>2021-12-15 10:41:39 +0100
committerAlex <alex@adnab.me>2021-12-15 10:41:39 +0100
commit60d445992632a4962f709f9c9a19f698caf0e4af (patch)
tree7acf96d8cf8c8095e99aad46e55aaa23b80daf71 /src/api/api_server.rs
parent3b3a1f275f18e4b6cbf1fb326ff9263fcf85460c (diff)
downloadgarage-60d445992632a4962f709f9c9a19f698caf0e4af.tar.gz
garage-60d445992632a4962f709f9c9a19f698caf0e4af.zip
BucketWebsite (#174)
fix #77 this does not store anything but a on/off switch for website, and does not implement GetBucketWebsite as it would require storing more. GetBucketWebsite should be pretty easy to implement once data is stored though. Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com> Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/174 Co-authored-by: trinity-1686a <trinity.pointard@gmail.com> Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
Diffstat (limited to 'src/api/api_server.rs')
-rw-r--r--src/api/api_server.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/api/api_server.rs b/src/api/api_server.rs
index 6d6e5b68..2de86233 100644
--- a/src/api/api_server.rs
+++ b/src/api/api_server.rs
@@ -22,6 +22,7 @@ use crate::s3_get::*;
use crate::s3_list::*;
use crate::s3_put::*;
use crate::s3_router::{Authorization, Endpoint};
+use crate::s3_website::*;
/// Run the S3 API server
pub async fn run_api_server(
@@ -254,6 +255,10 @@ async fn handler_inner(garage: Arc<Garage>, req: Request<Body>) -> Result<Respon
Endpoint::DeleteObjects { bucket } => {
handle_delete_objects(garage, &bucket, req, content_sha256).await
}
+ Endpoint::PutBucketWebsite { bucket } => {
+ handle_put_website(garage, bucket, req, content_sha256).await
+ }
+ Endpoint::DeleteBucketWebsite { bucket } => handle_delete_website(garage, bucket).await,
endpoint => Err(Error::NotImplemented(endpoint.name().to_owned())),
}
}