v0.36.5
This commit is contained in:
1 parent
34490fd5fc
commit
6ef01212ec
21 files changed
+204
-77
No files matched your search
+10
-2
@@ -37,7 +37,11 @@ fn default_page() -> crate::pages::Page {
|
||||
|
||||
impl Host {
|
||||
pub fn validate(&mut self) -> Result<()> {
|
||||
ensure!(crate::config::valid_id(&self.id), "invalid 404 host id");
|
||||
ensure!(
|
||||
crate::config::valid_id(&self.id),
|
||||
"invalid 404 host id {:?}: use 1-64 letters, digits, '-' or '_'",
|
||||
self.id
|
||||
);
|
||||
if self.name.trim().is_empty() {
|
||||
self.name = self.id.clone();
|
||||
}
|
||||
@@ -55,7 +59,11 @@ impl Host {
|
||||
let mut hosts = std::collections::HashSet::new();
|
||||
for host in &mut self.frontend.hosts {
|
||||
*host = crate::config::normalize_host_pattern(host)?;
|
||||
ensure!(hosts.insert(host.clone()), "duplicate 404 hostname");
|
||||
ensure!(
|
||||
hosts.insert(host.clone()),
|
||||
"hostname {} is listed twice in this 404 host",
|
||||
host
|
||||
);
|
||||
}
|
||||
ensure!(
|
||||
!self.frontend.listener_ids.is_empty() && self.frontend.listener_ids.len() <= 16,
|
||||
|
||||
Reference in new issue
Block a user