]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Allow `_` in `Hostname`s
authorMatt Corallo <git@bluematt.me>
Mon, 30 Sep 2024 18:03:12 +0000 (18:03 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 30 Sep 2024 18:04:01 +0000 (18:04 +0000)
These are perfectly fine and are relied on by BIP 353, so we need
to ensure we allow them.

lightning/src/util/ser.rs

index 21ce044e3c9fb45a7a65946b147f005c92f8aab0..e27d492930ea7a25a15ecc843c4c6a197888d809 100644 (file)
@@ -1496,8 +1496,7 @@ impl Hostname {
                s.len() <= 255 &&
                s.chars().all(|c|
                        c.is_ascii_alphanumeric() ||
-                       c == '.' ||
-                       c == '-'
+                       c == '.' || c == '_' || c == '-'
                )
        }
 }