This commit is contained in:
Mateusz Gruszczyński committed 2026-10-13 22:54:52 +02:00
1 parent b0f211555a
commit 8b9ca4db44
39 files changed
+1481 -303

No files matched your search

+19
View File
@@ -348,6 +348,25 @@ fn force_ssl_requires_plain_http_and_chooses_https_target() {
let error = compile(c, 4, &policy()).unwrap_err().to_string();
assert!(error.contains("plain HTTP listener"), "{error}");
}
#[test]
fn preserve_host_is_valid_with_every_upstream_protocol() {
for protocol in [
UpstreamProtocol::Http1,
UpstreamProtocol::Auto,
UpstreamProtocol::Http2,
UpstreamProtocol::H2,
] {
let mut config = demo_config("127.0.0.1:9000".parse().unwrap());
let member = &mut config.vhosts[0].backends[0];
member.url = "https://10.87.20.2:443".into();
member.allow_private = true;
member.preserve_host = true;
member.protocol = protocol;
let snapshot = compile(config, 1, &policy()).unwrap();
assert!(snapshot.pools[0].members[0].backend.preserve_host);
}
}
#[test]
fn backend_tls_server_name_keeps_network_origin_and_changes_verified_request_name() {
let mut c = demo_config("127.0.0.1:9000".parse().unwrap());