Skip to main content

routing_key_from_host

Function routing_key_from_host 

Source
pub fn routing_key_from_host(host: &str) -> Option<String>
Expand description

Host header → routing key. "pulse-korp.localhost:8090" and "pulse-korp.localhost" both become "pulse-korp". A Host that isn’t .localhost is still accepted (minus port, lowercased) rather than rejected outright — an empty/missing Host is the only thing that produces None. Whether the key actually resolves to anything is the registry lookup’s job, not this function’s; either way the caller gets a clear “no dev server registered for <key>” 404, never a confusing hostname-format error.