feat: allow HTTP operation on private LAN addresses
This commit is contained in:
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user