rename Condition into RedirectCondition in internal model
Some checks failed
ci/woodpecker/pr/debug Pipeline failed
Some checks failed
ci/woodpecker/pr/debug Pipeline failed
This commit is contained in:
parent
3151695011
commit
e4b0723aa3
2 changed files with 9 additions and 7 deletions
|
@ -246,9 +246,11 @@ impl WebsiteConfiguration {
|
|||
.into_iter()
|
||||
.map(|rule| {
|
||||
bucket_table::RoutingRule {
|
||||
condition: rule.condition.map(|condition| bucket_table::Condition {
|
||||
http_error_code: condition.http_error_code.map(|c| c.0 as u16),
|
||||
prefix: condition.prefix.map(|p| p.0),
|
||||
condition: rule.condition.map(|condition| {
|
||||
bucket_table::RedirectCondition {
|
||||
http_error_code: condition.http_error_code.map(|c| c.0 as u16),
|
||||
prefix: condition.prefix.map(|p| p.0),
|
||||
}
|
||||
}),
|
||||
redirect: bucket_table::Redirect {
|
||||
hostname: rule.redirect.hostname.map(|h| h.0),
|
||||
|
@ -435,7 +437,7 @@ mod tests {
|
|||
routing_rules: RoutingRules {
|
||||
rules: vec![
|
||||
RoutingRule {
|
||||
condition: Some(Condition {
|
||||
condition: Some(RedirectCondition {
|
||||
http_error_code: Some(IntValue(404)),
|
||||
prefix: Some(Value("prefix1".to_owned())),
|
||||
}),
|
||||
|
@ -448,7 +450,7 @@ mod tests {
|
|||
},
|
||||
},
|
||||
RoutingRule {
|
||||
condition: Some(Condition {
|
||||
condition: Some(RedirectCondition {
|
||||
http_error_code: None,
|
||||
prefix: Some(Value("".to_owned())),
|
||||
}),
|
||||
|
|
|
@ -185,12 +185,12 @@ mod v2 {
|
|||
|
||||
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct RoutingRule {
|
||||
pub condition: Option<Condition>,
|
||||
pub condition: Option<RedirectCondition>,
|
||||
pub redirect: Redirect,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Condition {
|
||||
pub struct RedirectCondition {
|
||||
pub http_error_code: Option<u16>,
|
||||
pub prefix: Option<String>,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue