{"record":{"id":"e5884c49900ee1a9","repo":"BigPizzaV3/CodexPlusPlus","slug":"base-url-e5884c","errorCode":null,"errorMessage":"Base URL 格式无效","messagePattern":"Base URL 格式无效","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/routes.rs","lineNumber":769,"sourceCode":"        .map(str::trim)\n        .is_some_and(|value| value.eq_ignore_ascii_case(\"application/json\"))\n    {\n        serde_json::from_slice::<Value>(&bytes).ok()\n    } else {\n        None\n    };\n\n    Ok(json!({\n        \"status\": \"ok\",\n        \"http_status\": http_status,\n        \"ok\": ok,\n        \"body_text\": body_text,\n        \"body_json\": body_json,\n    }))\n}\n\nfn validate_llm_proxy_url(raw: &str) -> anyhow::Result<reqwest::Url> {\n    let url = reqwest::Url::parse(raw.trim()).map_err(|_| anyhow::anyhow!(\"Base URL 格式无效\"))?;\n    if url.scheme() != \"https\" {\n        anyhow::bail!(\"Base URL 必须使用 HTTPS\");\n    }\n    if !url.username().is_empty() || url.password().is_some() {\n        anyhow::bail!(\"Base URL 不得包含用户名或密码\");\n    }\n    let host = url\n        .host_str()\n        .ok_or_else(|| anyhow::anyhow!(\"Base URL 缺少主机名\"))?;\n    if is_blocked_llm_proxy_host(host) {\n        anyhow::bail!(\"Base URL 不得指向本机或私有网络\");\n    }\n    Ok(url)\n}\n\nfn is_blocked_llm_proxy_host(host: &str) -> bool {\n    let host = host\n        .trim()","sourceCodeStart":751,"sourceCodeEnd":787,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/routes.rs#L751-L787","documentation":"validate_llm_proxy_url parses the user-supplied Base URL with reqwest::Url::parse and maps any parse failure to this error. It fires during LLM proxy configuration when the string is not a syntactically valid absolute URL (missing scheme, illegal characters, etc.), before the HTTPS and credential checks run.","triggerScenarios":"Thrown at crates/codex-plus-core/src/routes.rs:769 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the scheme, e.g. https://api.example.com/v1","Remove trailing spaces or stray characters from the URL","Use a full absolute URL, not a host-only or relative string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}