{"record":{"id":"f019c2273afc98e7","repo":"fish2018/pansou","slug":"error-f019c2","errorCode":null,"errorMessage":"站点地址缺少域名","messagePattern":"站点地址缺少域名","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/gying/gying.go","lineNumber":612,"sourceCode":"func 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 {\n\t\treturn \"\", fmt.Errorf(\"站点域名格式错误: %v\", err)\n\t}\n\thost := hostname\n\tif port := parsed.Port(); port != \"\" {\n\t\thost += \":\" + port\n\t}","sourceCodeStart":594,"sourceCodeEnd":630,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/gying/gying.go#L594-L630","documentation":"Validation error in normalizeBaseURL (plugin/gying/gying.go:612): the configured site address parsed successfully but has an empty Host component (e.g. only a scheme was given), so no requests could be addressed. Indicates a misconfigured base URL lacking a domain.","triggerScenarios":"normalizeBaseURL: parsed.Scheme is http/https but parsed.Host == \"\" — e.g. input 'https://' or 'https:///path' where the authority part is missing.","commonSituations":"配置中只填了路径或前缀；域名部分被误删。","solutions":["Supply the full address including the domain: https://your-gying-site.org.","Check that environment/config templating actually substituted the host placeholder.","Re-copy the URL from the browser address bar and verify nothing was truncated."],"exampleFix":"// before\n\"site\": \"https://\"\n// after\n\"site\": \"https://gying.example.org\"","handlingStrategy":"validation","validationCode":"u, err := url.Parse(strings.TrimSpace(cfg.Site))\nif err != nil || u.Host == \"\" {\n    return fmt.Errorf(\"gying site address must include a host, e.g. https://example.org\")\n}","typeGuard":null,"tryCatchPattern":"if err := plugin.Configure(cfg); err != nil {\n    if strings.Contains(err.Error(), \"站点地址缺少域名\") {\n        return fmt.Errorf(\"gying site config is missing the domain: %w\", err)\n    }\n    return err\n}","preventionTips":["Verify the configured URL contains a domain after the scheme","Ensure config templating variables (e.g. ${SITE}) are actually substituted","Replace placeholder values before deployment","Validate with url.Parse and require a non-empty Host at startup"],"tags":["url","configuration","missing-host","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"}