diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-12-17 22:51:44 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-12-17 22:51:44 +0100 |
commit | 2f4378a9c42cc3a78b992905e980e8977e6c5e58 (patch) | |
tree | 844b3796f20220d2b686704aa972a487bfc9c3f3 /src | |
parent | ccda9ab1caa6e20c81a9a41449c60ed6a7799659 (diff) | |
download | garage-2f4378a9c42cc3a78b992905e980e8977e6c5e58.tar.gz garage-2f4378a9c42cc3a78b992905e980e8977e6c5e58.zip |
Fix formatting
Diffstat (limited to 'src')
-rw-r--r-- | src/web/web_server.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/web/web_server.rs b/src/web/web_server.rs index 9effa86c..25a7cd5f 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -13,9 +13,9 @@ use idna::domain_to_unicode; use crate::error::*; use garage_api::s3_get::{handle_get, handle_head}; -use garage_table::*; use garage_model::bucket_table::*; use garage_model::garage::Garage; +use garage_table::*; use garage_util::error::Error as GarageError; pub async fn run_web_server( @@ -78,19 +78,19 @@ async fn serve_file(garage: Arc<Garage>, req: Request<Body>) -> Result<Response< let root = &garage.config.s3_web.root_domain; let bucket = host_to_bucket(&host, root); - // Check bucket is exposed as a website - let bucket_desc = garage - .bucket_table - .get(&EmptyKey, &bucket.to_string()) - .await? - .filter(|b| !b.is_deleted()) - .ok_or(Error::NotFound)?; - - match bucket_desc.state.get() { - BucketState::Deleted => Err(Error::NotFound), - BucketState::Present(params) if !params.website.get() => Err(Error::NotFound), - _ => Ok(()), - }?; + // Check bucket is exposed as a website + let bucket_desc = garage + .bucket_table + .get(&EmptyKey, &bucket.to_string()) + .await? + .filter(|b| !b.is_deleted()) + .ok_or(Error::NotFound)?; + + match bucket_desc.state.get() { + BucketState::Deleted => Err(Error::NotFound), + BucketState::Present(params) if !params.website.get() => Err(Error::NotFound), + _ => Ok(()), + }?; // Get path let path = req.uri().path().to_string(); |