{"record":{"id":"2146b2a66f99c862","repo":"BigPizzaV3/CodexPlusPlus","slug":"codex-2146b2","errorCode":null,"errorMessage":"仅支持 Codex++ 分享站点链接","messagePattern":"仅支持 Codex\\+\\+ 分享站点链接","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/session_share.rs","lineNumber":110,"sourceCode":"        .fragment()\n        .and_then(|fragment| {\n            fragment\n                .split('&')\n                .find_map(|pair| pair.strip_prefix(\"k=\"))\n        })\n        .context(\"分享链接缺少解密密钥\")?;\n    let plaintext = decrypt_shared_payload(encrypted, key_value)?;\n    let payload: Value = serde_json::from_slice(&plaintext).context(\"分享会话内容格式无效\")?;\n    if payload.get(\"kind\").and_then(Value::as_str) != Some(\"codex-rollout\") {\n        bail!(\"当前分享内容不是可导入的 Codex rollout 会话\");\n    }\n    import_rollout(home, &payload)\n}\n\nfn validate_share_url(url: &str) -> anyhow::Result<reqwest::Url> {\n    let parsed = reqwest::Url::parse(url.trim()).context(\"分享 URL 格式无效\")?;\n    if parsed.scheme() != \"https\" || !parsed.host_str().is_some_and(|host| SHARE_HOSTS.contains(&host)) {\n        bail!(\"仅支持 Codex++ 分享站点链接\");\n    }\n    if parsed.fragment().is_none() {\n        bail!(\"分享链接缺少解密密钥\");\n    }\n    Ok(parsed)\n}\n\nfn decrypt_shared_payload(encrypted: &Value, key_value: &str) -> anyhow::Result<Vec<u8>> {\n    if encrypted.get(\"v\").and_then(Value::as_u64) != Some(1) {\n        bail!(\"不支持此分享的数据格式\");\n    }\n    let decode = |field: &str| -> anyhow::Result<Vec<u8>> {\n        let value = encrypted\n            .get(field)\n            .and_then(Value::as_str)\n            .with_context(|| format!(\"分享数据缺少 {field}\"))?;\n        base64::engine::general_purpose::URL_SAFE_NO_PAD\n            .decode(value)","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/session_share.rs#L92-L128","documentation":"Thrown by validate_share_url when the URL's scheme is not https or its host is not one of SHARE_HOSTS (share.codexpp.cc / codexpp-share.pages.dev). This is an origin allow-list on the session-share fetcher; the offending input is the user-supplied share URL, rejected before any network request is made. Called from save/load/import paths alike.","triggerScenarios":"Thrown at crates/codex-plus-core/src/session_share.rs:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["使用官方分享站点域名下的链接"],"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"}