{"record":{"id":"03dd663cf96c79b8","repo":"tinyhumansai/openhuman","slug":"url-cannot-be-empty-03dd66","errorCode":null,"errorMessage":"URL cannot be empty","messagePattern":"URL cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/browser/browser_open.rs","lineNumber":25,"sourceCode":"/// Open approved HTTPS URLs in Brave Browser (no scraping, no DOM automation).\npub struct BrowserOpenTool {\n    security: Arc<SecurityPolicy>,\n    allowed_domains: Vec<String>,\n}\n\nimpl BrowserOpenTool {\n    pub fn new(security: Arc<SecurityPolicy>, allowed_domains: Vec<String>) -> Self {\n        Self {\n            security,\n            allowed_domains: normalize_allowed_domains(allowed_domains),\n        }\n    }\n\n    fn validate_url(&self, raw_url: &str) -> anyhow::Result<String> {\n        let url = raw_url.trim();\n\n        if url.is_empty() {\n            anyhow::bail!(\"URL cannot be empty\");\n        }\n\n        if url.chars().any(char::is_whitespace) {\n            anyhow::bail!(\"URL cannot contain whitespace\");\n        }\n\n        if !url.starts_with(\"https://\") {\n            anyhow::bail!(\"Only https:// URLs are allowed\");\n        }\n\n        if self.allowed_domains.is_empty() {\n            anyhow::bail!(\n                \"Browser tool is enabled but no allowed_domains are configured. Add [browser].allowed_domains in config.toml\"\n            );\n        }\n\n        let host = extract_host(url)?;\n","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/browser/browser_open.rs#L7-L43","documentation":"Guard in BrowserOpenTool::validate_url rejecting an empty or whitespace-only URL string before any parsing or policy checks. It fires when the caller passes a blank `url` argument to the browser_open tool; the tool only opens pre-approved HTTPS URLs, so there is nothing to open. Fix: supply a non-empty https:// URL.","triggerScenarios":"Thrown at src/openhuman/tools/impl/browser/browser_open.rs:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a concrete https:// URL to open.","Fix the argument source that yielded the blank value."],"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"}