Skip to main content

host_without_port

Function host_without_port 

Source
pub fn host_without_port(name: &str) -> &str
Expand description

A hostname without the port it is reached on.

A person types the port their server answers on; a did:web, a record key and a zone all carry none. This is the half of a typed name that can be compared against any of them.

use didbot_identity::did::host_without_port;
assert_eq!(host_without_port("agents.localhost:3000"), "agents.localhost");
assert_eq!(host_without_port("agents.example.com"), "agents.example.com");