{"record":{"id":"90ae892c15998825","repo":"chenhg5/cc-connect","slug":"s-invalid-domain-q-w","errorCode":null,"errorMessage":"%s: invalid domain %q: %w","messagePattern":"(.+?): invalid domain %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/feishu/feishu.go","lineNumber":341,"sourceCode":"func (p *Platform) SetCardNavigationHandler(h core.CardNavigationHandler) {\n\tp.cardNavHandler = h\n}\n\nfunc New(opts map[string]any) (core.Platform, error) {\n\treturn newPlatform(\"feishu\", lark.FeishuBaseUrl, opts)\n}\n\nfunc newPlatform(name, domain string, opts map[string]any) (core.Platform, error) {\n\tappID, _ := opts[\"app_id\"].(string)\n\tappSecret, _ := opts[\"app_secret\"].(string)\n\tif appID == \"\" || appSecret == \"\" {\n\t\treturn nil, fmt.Errorf(\"%s: app_id and app_secret are required\", name)\n\t}\n\tif v, ok := opts[\"domain\"].(string); ok {\n\t\tv = strings.TrimSpace(v)\n\t\tif v != \"\" {\n\t\t\tif _, err := url.ParseRequestURI(v); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"%s: invalid domain %q: %w\", name, v, err)\n\t\t\t}\n\t\t\tdomain = v\n\t\t}\n\t}\n\treactionEmoji, _ := opts[\"reaction_emoji\"].(string)\n\tif reactionEmoji == \"\" {\n\t\treactionEmoji = \"OnIt\"\n\t}\n\tif v, ok := opts[\"reaction_emoji\"].(string); ok && v == \"none\" {\n\t\treactionEmoji = \"\"\n\t}\n\tdoneEmoji, _ := opts[\"done_emoji\"].(string)\n\tif doneEmoji == \"none\" {\n\t\tdoneEmoji = \"\"\n\t}\n\tallowFrom, _ := opts[\"allow_from\"].(string)\n\tcore.CheckAllowFrom(name, allowFrom)\n\tallowChat, _ := opts[\"allow_chat\"].(string)","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/feishu/feishu.go#L323-L359","documentation":"The optional domain option, when set, must parse as a valid request URI via url.ParseRequestURI; otherwise newPlatform aborts. This catches malformed Feishu/Lark API base URLs before any client is built.","triggerScenarios":"domain = \"open.feishu.cn\" (missing scheme), \"https://open feishu.cn\" (space), or any string ParseRequestURI rejects — e.g. missing protocol or control characters.","commonSituations":"Users omitting https:// from the domain; pasting URLs with trailing whitespace/newlines (trim handles plain spaces, not embedded ones); using the Lark domain url.open... misspellings.","solutions":["Include the scheme: domain = \"https://open.feishu.cn\".","Remove whitespace or invisible characters from the domain value.","Omit the domain option entirely to use the default Feishu domain."],"exampleFix":"// before (config.toml)\ndomain = \"open.feishu.cn\"\n// after\ndomain = \"https://open.feishu.cn\"","handlingStrategy":"validation","validationCode":"d := strings.TrimSpace(cfg.Domain)\nif d != \"\" {\n    if _, err := url.ParseRequestURI(d); err != nil {\n        log.Fatalf(\"invalid feishu domain %q: %v\", d, err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the https:// scheme in domain values.","Omit domain entirely unless using Lark or a custom gateway.","Test the URL with curl before putting it in config."],"tags":["feishu","config","url-validation"],"backgroundTag":"invalid-url-format","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}