This commit is contained in:
trinity-1686a
2024-12-22 15:26:06 +01:00
parent 65e9dde8c9
commit c939d2a936
3 changed files with 11 additions and 13 deletions
+4 -6
View File
@@ -330,12 +330,10 @@ impl Condition {
impl Redirect {
pub fn validate(&self) -> Result<(), Error> {
if self.replace_prefix.is_some() {
if self.replace_full.is_some() {
return Err(Error::bad_request(
"Bad XML: both ReplaceKeyPrefixWith and ReplaceKeyWith are set",
));
}
if self.replace_prefix.is_some() && self.replace_full.is_some() {
return Err(Error::bad_request(
"Bad XML: both ReplaceKeyPrefixWith and ReplaceKeyWith are set",
));
}
if let Some(ref protocol) = self.protocol {
if protocol.0 != "http" && protocol.0 != "https" {