{"record":{"id":"9bcf8032b35535a9","repo":"openai/codex","slug":"host-is-empty","errorCode":null,"errorMessage":"host is empty","messagePattern":"host is empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/network-proxy/src/policy.rs","lineNumber":23,"sourceCode":"use anyhow::bail;\nuse anyhow::ensure;\nuse globset::GlobBuilder;\nuse globset::GlobSet;\nuse globset::GlobSetBuilder;\nuse std::collections::HashSet;\nuse std::net::IpAddr;\nuse std::net::Ipv4Addr;\nuse std::net::Ipv6Addr;\nuse url::Host as UrlHost;\n\n/// A normalized host string for policy evaluation.\n#[derive(Clone, Debug, PartialEq, Eq, Hash)]\npub struct Host(String);\n\nimpl Host {\n    pub fn parse(input: &str) -> Result<Self> {\n        let normalized = normalize_host(input);\n        ensure!(!normalized.is_empty(), \"host is empty\");\n        Ok(Self(normalized))\n    }\n\n    pub fn as_str(&self) -> &str {\n        &self.0\n    }\n}\n\n/// Returns true if the host is a loopback hostname or IP literal.\npub fn is_loopback_host(host: &Host) -> bool {\n    let host = host.as_str();\n    let host = unscoped_ip_literal(host).unwrap_or(host);\n    if host == \"localhost\" {\n        return true;\n    }\n    if let Ok(ip) = host.parse::<IpAddr>() {\n        return ip.is_loopback();\n    }","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/network-proxy/src/policy.rs#L5-L41","documentation":"Error \"host is empty\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/network-proxy/src/policy.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}