This commit is contained in:
parent
6fef0f4cad
commit
fd341177e9
1 changed files with 7 additions and 8 deletions
|
@ -134,15 +134,14 @@ 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()?;
|
||||||
|
|
Loading…
Reference in a new issue