0.34.6_repo_cleanup

This commit is contained in:
Mateusz Gruszczyński committed 2026-10-22 09:31:15 +02:00
1 parent ce1a90397c
commit 133d2f0f91
273 files changed
+5969 -6926

No files matched your search

+33
View File
@@ -264,3 +264,36 @@ mod default_listener_tests {
}
}
}
mod websocket_protocol_flags_tests {
use super::Vhost;
#[test]
fn rfc8441_vhost_flag_deserializes_explicitly() {
let value = serde_json::json!({
"id": "ws-h2",
"frontend": {"hosts": ["example.test"], "listener_ids": ["http"]},
"backends": [{"id": "origin", "url": "http://127.0.0.1:9000", "allow_private": true}],
"websockets": true,
"websocket_rfc8441": true,
"http2_enabled": true
});
let host: Vhost = serde_json::from_value(value).unwrap();
assert!(host.websockets && host.websocket_rfc8441 && host.http2_enabled);
}
#[test]
fn rfc9220_vhost_flag_deserializes_explicitly() {
let value = serde_json::json!({
"id": "ws-h3",
"frontend": {"hosts": ["example.test"], "listener_ids": ["https"]},
"backends": [{"id": "origin", "url": "http://127.0.0.1:9000", "allow_private": true}],
"websockets": true,
"websocket_rfc9220": true
});
let host: Vhost = serde_json::from_value(value).unwrap();
assert!(host.websockets && host.websocket_rfc9220);
assert!(r#"{"websocket_rfc9220":true}"#.contains("\"websocket_rfc9220\":true"));
}
}