Documentation

i18n_gateway

pub mod cert;
pub mod cert_loader;
pub use cert_loader::{CertLoader, LoadCert};
pub mod error;
pub mod route;
pub use error::{Error, Result};
pub use route::{Route, SiteConf};
mod srv;
pub use srv::srv;
mod proxy;
pub use proxy::proxy;

pub fn req_host<B>(req: &hyper::Request<B>) -> &str {
  req
    .headers()
    .get("host")
    .map(|h| h.to_str().unwrap_or_default())
    .unwrap_or_else(|| req.uri().host().unwrap_or_default())
}