{"record":{"id":"376862235f187076","repo":"tinyhumansai/openhuman","slug":"url-must-include-a-host","errorCode":null,"errorMessage":"URL must include a host","messagePattern":"URL must include a host","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/browser/browser_open.rs","lineNumber":211,"sourceCode":"    if d.is_empty() || d.chars().any(char::is_whitespace) {\n        return None;\n    }\n\n    Some(d)\n}\n\nfn extract_host(url: &str) -> anyhow::Result<String> {\n    let rest = url\n        .strip_prefix(\"https://\")\n        .ok_or_else(|| anyhow::anyhow!(\"Only https:// URLs are allowed\"))?;\n\n    let authority = rest\n        .split(['/', '?', '#'])\n        .next()\n        .ok_or_else(|| anyhow::anyhow!(\"Invalid URL\"))?;\n\n    if authority.is_empty() {\n        anyhow::bail!(\"URL must include a host\");\n    }\n\n    if authority.contains('@') {\n        anyhow::bail!(\"URL userinfo is not allowed\");\n    }\n\n    if authority.starts_with('[') {\n        anyhow::bail!(\"IPv6 hosts are not supported in browser_open\");\n    }\n\n    let host = authority\n        .split(':')\n        .next()\n        .unwrap_or_default()\n        .trim()\n        .trim_end_matches('.')\n        .to_lowercase();\n","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/browser/browser_open.rs#L193-L229","documentation":"extract_host fails when the authority portion of the https URL (text before the first '/', '?', or '#') is empty, e.g. \"https://\" or \"https:///path\". Without a host there is nothing to check against the allowlist or private-host rules.","triggerScenarios":"Thrown at src/openhuman/tools/impl/browser/browser_open.rs:211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include a hostname in the URL (https://example.com/...).","Fix the URL construction that dropped the authority."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}