{"record":{"id":"1530dac341c557e5","repo":"fish2018/pansou","slug":"v","errorCode":null,"errorMessage":"站点地址格式错误: %v","messagePattern":"站点地址格式错误: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/gying/gying.go","lineNumber":606,"sourceCode":"\t\tBaseAsyncPlugin: plugin.NewBaseAsyncPlugin(\"gying\", 3),\n\t}\n\n\tplugin.RegisterGlobalPlugin(p)\n}\n\nfunc normalizeBaseURL(raw string) (string, error) {\n\tbaseURL := strings.TrimSpace(raw)\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tif baseURL == \"\" {\n\t\treturn \"\", fmt.Errorf(\"站点地址不能为空\")\n\t}\n\tif !strings.HasPrefix(baseURL, \"http://\") && !strings.HasPrefix(baseURL, \"https://\") {\n\t\tbaseURL = \"https://\" + baseURL\n\t}\n\n\tparsed, err := url.Parse(baseURL)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"站点地址格式错误: %v\", err)\n\t}\n\tif parsed.Scheme != \"http\" && parsed.Scheme != \"https\" {\n\t\treturn \"\", fmt.Errorf(\"站点地址必须以 http:// 或 https:// 开头\")\n\t}\n\tif parsed.Host == \"\" {\n\t\treturn \"\", fmt.Errorf(\"站点地址缺少域名\")\n\t}\n\tif parsed.RawQuery != \"\" || parsed.Fragment != \"\" {\n\t\treturn \"\", fmt.Errorf(\"站点地址不能包含参数或锚点\")\n\t}\n\tif parsed.Path != \"\" && parsed.Path != \"/\" {\n\t\treturn \"\", fmt.Errorf(\"站点地址不能包含路径\")\n\t}\n\n\t// HTTP clients do not consistently convert Unicode hostnames to IDNA.\n\t// Store the ASCII form so both the config page and requests are reliable.\n\thostname, err := idna.Lookup.ToASCII(parsed.Hostname())\n\tif err != nil {","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/gying/gying.go#L588-L624","documentation":"URL parse error in gying's normalizeBaseURL (plugin/gying/gying.go:606): after scheme defaulting, net/url could not parse the configured site address. Means the configured base URL is syntactically invalid (bad characters/format), not merely unreachable.","triggerScenarios":"normalizeBaseURL: after prepending \"https://\" when the scheme prefix was missing, url.Parse returned a non-nil error (e.g. control characters, invalid percent-encodings, spaces in host).","commonSituations":"用户在配置文件中粘贴了带空格或换行的地址；地址被截断。","solutions":["Paste the address into a browser address bar first — if it does not resolve there, fix it.","Remove whitespace/control characters and re-encode special characters.","Ensure the value is a bare origin like https://host[:port] with no junk characters."],"exampleFix":"// before\n\"site\": \"https://exa mple.com\"\n// after\n\"site\": \"https://example.com\"","handlingStrategy":"validation","validationCode":"site := strings.TrimSpace(cfg.Site)\nif u, err := url.Parse(site); err != nil || u.Scheme == \"\" {\n    if _, err2 := url.Parse(\"https://\" + site); err2 != nil {\n        return fmt.Errorf(\"gying site address is not a valid URL: %v\", err2)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := plugin.Configure(cfg); err != nil {\n    if strings.Contains(err.Error(), \"站点地址格式错误\") {\n        return fmt.Errorf(\"fix the gying site URL in config: %w\", err)\n    }\n    return err\n}","preventionTips":["Sanitize config values: strip whitespace, newlines, and control characters","Test-paste the URL in a browser before saving it to config","Avoid manual typing of URLs; copy from the address bar","Run url.Parse on configured URLs in your own startup validation"],"tags":["url","configuration","validation","go"],"backgroundTag":"invalid-url-format","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"}