Skip to main content

get_host

Function get_host 

Source
pub fn get_host(header: &RequestHeader) -> Option<&str>
Expand description

Gets the request host by checking the URI first, then falling back to the “Host” header.

This function follows the common practice of prioritizing the host from the absolute URI (e.g., in GET http://example.com/path HTTP/1.1) over the Host header field.