BucketWebsite #174

Merged
lx merged 4 commits from trinity-1686a/garage:BucketWebsite into main 2021-12-15 09:41:40 +00:00
Showing only changes of commit fd341177e9 - Show all commits

View file

@ -134,16 +134,15 @@ pub struct Redirect {
impl WebsiteConfiguration { impl WebsiteConfiguration {
pub fn validate(&self) -> Result<(), Error> { pub fn validate(&self) -> Result<(), Error> {
if self.redirect_all_requests_to.is_some() { if self.redirect_all_requests_to.is_some()
if self.error_document.is_some() && (self.error_document.is_some()
|| self.index_document.is_some() || self.index_document.is_some()
|| self.routing_rules.is_some() || self.routing_rules.is_some())
{ {
return Err(Error::BadRequest( return Err(Error::BadRequest(
"Bad XML: can't have RedirectAllRequestsTo and other fields".to_owned(), "Bad XML: can't have RedirectAllRequestsTo and other fields".to_owned(),
)); ));
} }
}
if let Some(ref ed) = self.error_document { if let Some(ref ed) = self.error_document {
ed.validate()?; ed.validate()?;
} }