Split and normalize a node name from a hello response.
(node: str)
| 163 | |
| 164 | |
| 165 | def clean_node(node: str) -> tuple[str, int]: |
| 166 | """Split and normalize a node name from a hello response.""" |
| 167 | host, port = partition_node(node) |
| 168 | |
| 169 | # Normalize hostname to lowercase, since DNS is case-insensitive: |
| 170 | # https://tools.ietf.org/html/rfc4343 |
| 171 | # This prevents useless rediscovery if "foo.com" is in the seed list but |
| 172 | # "FOO.com" is in the hello response. |
| 173 | return host.lower(), port |
| 174 | |
| 175 | |
| 176 | def raise_config_error(key: str, suggestions: Optional[list[str]] = None) -> NoReturn: |