{"record":{"id":"425999b973682a9c","repo":"BigPizzaV3/CodexPlusPlus","slug":"base-url-https","errorCode":null,"errorMessage":"Base URL 必须使用 HTTPS","messagePattern":"Base URL 必须使用 HTTPS","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/routes.rs","lineNumber":771,"sourceCode":"    {\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()\n        .trim_start_matches('[')\n        .trim_end_matches(']')","sourceCodeStart":753,"sourceCodeEnd":789,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/routes.rs#L753-L789","documentation":"Thrown by validate_llm_proxy_url when the parsed Base URL's scheme is not https. The LLM Bridge proxy only forwards to TLS-protected endpoints since request bodies carry prompts and credentials; the offending input is the url field of the bridge payload, rejected after a successful URL parse but before any host checks.","triggerScenarios":"Thrown at crates/codex-plus-core/src/routes.rs:771 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["改用 https:// 开头的 Base URL"],"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"}