{"record":{"id":"75d99eb6650f3521","repo":"fish2018/pansou","slug":"w-75d99e","errorCode":null,"errorMessage":"验证页面地址无效: %w","messagePattern":"验证页面地址无效: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/qiwei/qiwei.go","lineNumber":376,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"获取验证脚本失败: %w\", err)\n\t}\n\n\ttypeMatch := verificationTypeRegex.FindStringSubmatch(jsBody)\n\tkeyMatch := verificationKeyRegex.FindStringSubmatch(jsBody)\n\tvalueMatch := verificationValueRegex.FindStringSubmatch(jsBody)\n\tif len(typeMatch) < 2 || len(keyMatch) < 2 || len(valueMatch) < 2 {\n\t\treturn fmt.Errorf(\"验证脚本参数不完整\")\n\t}\n\n\tencodedValue := md5StringToHex(valueMatch[1])\n\tendpointPath := \"/a20be899_96a6_40b2_88ba_32f1f75f1552_yanzheng_huadong.php\"\n\tif endpointMatch := verificationEndpointRegex.FindStringSubmatch(jsBody); len(endpointMatch) > 1 {\n\t\tendpointPath = \"/\" + endpointMatch[1]\n\t}\n\tparsedPage, err := url.Parse(pageURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"验证页面地址无效: %w\", err)\n\t}\n\tverifyURL := (&url.URL{Scheme: parsedPage.Scheme, Host: parsedPage.Host, Path: endpointPath}).String()\n\tquery := url.Values{}\n\tquery.Set(\"type\", typeMatch[1])\n\tquery.Set(\"key\", keyMatch[1])\n\tquery.Set(\"value\", encodedValue)\n\tverifyURL += \"?\" + query.Encode()\n\n\tctx, cancel := context.WithTimeout(context.Background(), detailTimeout)\n\tdefer cancel()\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, verifyURL, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"创建验证请求失败: %w\", err)\n\t}\n\tp.setHeaders(req, pageURL)\n\treq.Header.Set(\"X-Requested-With\", \"XMLHttpRequest\")\n\tresp, err := p.doRequestWithRetry(req, client)\n\tif err != nil {","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/qiwei/qiwei.go#L358-L394","documentation":"After extracting the verification endpoint path, solveVerification parses the original page URL with url.Parse. If the pageURL is malformed (unparseable scheme/host), the plugin cannot construct the verification endpoint URL and wraps the url.Parse error in this message.","triggerScenarios":"url.Parse(pageURL) returns an error inside solveVerification; practically only when a caller passed a malformed detail/suggest URL (e.g. containing invalid characters or no scheme) that earlier normalization let through.","commonSituations":"User-supplied or crawled detail URL containing control characters or spaces; URLs assembled by string concatenation without validation upstream; proxy-passthrough code passing an already-decoded/mangled URL.","solutions":["Validate the URL with url.Parse before calling searchSuggest/getDetailInfo and reject malformed input","Ensure URLs are passed in encoded form and never manually decoded before use","Inspect the wrapped %w error to see the exact parse failure from net/url"],"exampleFix":"// before\ninfo, err := plugin.GetDetailInfo(ctx, rawURL)\n// after\nif _, err := url.Parse(rawURL); err != nil {\n    return fmt.Errorf(\"invalid detail url: %w\", err)\n}\ninfo, err := plugin.GetDetailInfo(ctx, rawURL)","handlingStrategy":"validation","validationCode":"u, err := url.Parse(rawURL)\nif err != nil || u.Scheme == \"\" || u.Host == \"\" {\n    return fmt.Errorf(\"invalid detail url: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"info, err := plugin.GetDetailInfo(ctx, url)\nif err != nil && strings.Contains(err.Error(), \"验证页面地址无效\") {\n    return fmt.Errorf(\"skip malformed url %s: %w\", url, err)\n}","preventionTips":["Validate all URLs with url.Parse before passing them to the plugin","Never hand plugin code raw, unencoded URLs from user input","Reject scheme-relative (//host) URLs unless normalized to https first"],"tags":["url","verification","input-validation"],"backgroundTag":"invalid-url","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}