Skip to content

Commit 251303a

Browse files
committed
fix: update wiki URL validation pattern
1 parent 9b7ae97 commit 251303a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

utils/url.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ func ValidateFolderURL(url string) (string, error) {
3636
}
3737

3838
func ValidateWikiURL(url string) (string, string, error) {
39-
// reg := regexp.MustCompile("^https://[\\w-.]+/wiki/settings/([a-zA-Z0-9]+)")
40-
reg := regexp.MustCompile(`^(https://[\w-.]+)/wiki/settings/([a-zA-Z0-9]+)$`)
39+
reg := regexp.MustCompile(`^(https://[\w-.]+)/wiki/space/([a-zA-Z0-9]+)$`)
4140
matchResult := reg.FindStringSubmatch(url)
4241
if matchResult == nil || len(matchResult) != 3 {
43-
return "", "", errors.Errorf("Invalid feishu/larksuite folder URL pattern")
42+
return "", "", errors.Errorf("Invalid feishu/larksuite wiki URL pattern")
4443
}
4544
prefixURL := matchResult[1]
4645
wikiToken := matchResult[2]

0 commit comments

Comments
 (0)