v0.25.1
This commit is contained in:
1 parent
87e571c170
commit
fa7abc9e53
308 files changed
+49746
-50237
No files matched your search
+1
-29
@@ -99,32 +99,4 @@ pub fn compile(host: &Host, listeners: &crate::settings::Listeners) -> Result<Co
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn host(kind: crate::pages::Kind, status: u16) -> Host {
|
||||
Host {
|
||||
id: "missing".into(),
|
||||
name: "Missing".into(),
|
||||
enabled: true,
|
||||
http2_enabled: true,
|
||||
http3_enabled: true,
|
||||
frontend: crate::vhost::Frontend { hosts: vec!["missing.example".into()], listener_ids: vec!["http".into()] },
|
||||
certificate_id: None,
|
||||
page: crate::pages::Page { kind, status: Some(status), html: if matches!(kind, crate::pages::Kind::Html) { "<h1>missing</h1>".into() } else { String::new() } },
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn local_hosts_accept_only_known_error_statuses() {
|
||||
assert!(host(crate::pages::Kind::Welcome, 404).validate().is_ok());
|
||||
assert!(host(crate::pages::Kind::Empty, 502).validate().is_ok());
|
||||
assert!(host(crate::pages::Kind::Html, 418).validate().is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn application_style_hosts_require_a_bundled_template() {
|
||||
assert!(host(crate::pages::Kind::Builtin, 404).validate().is_ok());
|
||||
assert!(host(crate::pages::Kind::Builtin, 500).validate().is_err());
|
||||
}
|
||||
}
|
||||
include!("not_found/tests.rs");
|
||||
Reference in new issue
Block a user