feat: allow HTTP operation on private LAN addresses

This commit is contained in:
2026-11-16 06:48:36 +01:00
parent 4337f1d801
commit 870844dbe3
9 changed files with 83 additions and 31 deletions

View File

@ -57,3 +57,25 @@ fn pruefcode_ist_stabil_und_gruppiert() {
assert_ne!(pruefcode_aus_hash(&sha256_hex("abd")).unwrap(), code);
assert!(pruefcode_aus_hash("kein hash").is_err());
}
#[test]
fn http_ist_fuer_lan_und_loopback_erlaubt() {
for host in [
"192.168.1.4",
"10.0.0.4",
"172.16.0.1",
"127.0.0.1",
"localhost",
"[fd00::1]",
] {
assert!(keyforge_protokoll::lan_host(host));
}
for host in [
"8.8.8.8",
"172.32.0.1",
"example.org",
"[2001:4860:4860::8888]",
] {
assert!(!keyforge_protokoll::lan_host(host));
}
}