summaryrefslogtreecommitdiff
path: root/internal/util/regexes.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-08-29 16:52:23 +0200
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-09-01 11:11:26 +0200
commitd2276fc553332477740e2c320d51a9cbc3cf2585 (patch)
treee02e1433afeedbd442d8d9202ddad8a1261b549e /internal/util/regexes.go
parentImprove GetRemoteStatus and db.GetStatus() logic (#174) (diff)
downloadgotosocial-d2276fc553332477740e2c320d51a9cbc3cf2585.tar.xz
start working on struct validation for gtsmodel
Diffstat (limited to 'internal/util/regexes.go')
-rw-r--r--internal/util/regexes.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/util/regexes.go b/internal/util/regexes.go
index 88212fc43..d3a42d1fc 100644
--- a/internal/util/regexes.go
+++ b/internal/util/regexes.go
@@ -90,6 +90,7 @@ var (
followPathRegex = regexp.MustCompile(followPathRegexString)
ulidRegexString = `[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}`
+ ulidRegex = regexp.MustCompile(fmt.Sprintf(`^%s$`, ulidRegexString))
likedPathRegexString = fmt.Sprintf(`^/?%s/(%s)/%s$`, UsersPath, usernameRegexString, LikedPath)
// likedPathRegex parses a path that validates and captures the username part from eg /users/example_username/liked