add redirect_all to WebsiteConfig model
This commit is contained in:
parent
2aaba39ddc
commit
bf0f792418
4 changed files with 13 additions and 0 deletions
|
@ -423,6 +423,7 @@ pub async fn handle_update_bucket(
|
||||||
"Please specify indexDocument when enabling website access.",
|
"Please specify indexDocument when enabling website access.",
|
||||||
)?,
|
)?,
|
||||||
error_document: wa.error_document,
|
error_document: wa.error_document,
|
||||||
|
redirect_all: None,
|
||||||
routing_rules: Vec::new(),
|
routing_rules: Vec::new(),
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -238,6 +238,7 @@ impl WebsiteConfiguration {
|
||||||
.map(|x| x.suffix.0)
|
.map(|x| x.suffix.0)
|
||||||
.unwrap_or_else(|| "index.html".to_string()),
|
.unwrap_or_else(|| "index.html".to_string()),
|
||||||
error_document: self.error_document.map(|x| x.key.0),
|
error_document: self.error_document.map(|x| x.key.0),
|
||||||
|
redirect_all: None,
|
||||||
routing_rules: self
|
routing_rules: self
|
||||||
.routing_rules
|
.routing_rules
|
||||||
.rules
|
.rules
|
||||||
|
|
|
@ -393,6 +393,7 @@ impl AdminRpcHandler {
|
||||||
Some(WebsiteConfig {
|
Some(WebsiteConfig {
|
||||||
index_document: query.index_document.clone(),
|
index_document: query.index_document.clone(),
|
||||||
error_document: query.error_document.clone(),
|
error_document: query.error_document.clone(),
|
||||||
|
redirect_all: None,
|
||||||
routing_rules: Vec::new(),
|
routing_rules: Vec::new(),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -171,9 +171,18 @@ mod v2 {
|
||||||
pub struct WebsiteConfig {
|
pub struct WebsiteConfig {
|
||||||
pub index_document: String,
|
pub index_document: String,
|
||||||
pub error_document: Option<String>,
|
pub error_document: Option<String>,
|
||||||
|
// this field is currently unused, but present so adding it in the future doesn't
|
||||||
|
// need a new migration
|
||||||
|
pub redirect_all: Option<RedirectAll>,
|
||||||
pub routing_rules: Vec<RoutingRule>,
|
pub routing_rules: Vec<RoutingRule>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct RedirectAll {
|
||||||
|
pub hostname: String,
|
||||||
|
pub protocol: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct RoutingRule {
|
pub struct RoutingRule {
|
||||||
pub condition: Option<Condition>,
|
pub condition: Option<Condition>,
|
||||||
|
@ -212,6 +221,7 @@ mod v2 {
|
||||||
wc_opt.map(|wc| WebsiteConfig {
|
wc_opt.map(|wc| WebsiteConfig {
|
||||||
index_document: wc.index_document,
|
index_document: wc.index_document,
|
||||||
error_document: wc.error_document,
|
error_document: wc.error_document,
|
||||||
|
redirect_all: None,
|
||||||
routing_rules: vec![],
|
routing_rules: vec![],
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Add table
Reference in a new issue