summaryrefslogtreecommitdiff
path: root/internal/util/regexes.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-26 16:21:40 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-26 16:21:40 +0200
commitb6c62309f236410a2dabdcf254473be99d7e60a7 (patch)
tree88982f7b25dffdc5b3f4bfaac0de241752c1815d /internal/util/regexes.go
parentqad getting started guide (#63) (diff)
downloadgotosocial-b6c62309f236410a2dabdcf254473be99d7e60a7.tar.xz
separate public key handler (#64)
Diffstat (limited to 'internal/util/regexes.go')
-rw-r--r--internal/util/regexes.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/util/regexes.go b/internal/util/regexes.go
index 6ad7b7404..13c3ce3ef 100644
--- a/internal/util/regexes.go
+++ b/internal/util/regexes.go
@@ -60,6 +60,9 @@ var (
// userPathRegex parses a path that validates and captures the username part from eg /users/example_username
userPathRegex = regexp.MustCompile(userPathRegexString)
+ userPublicKeyPathRegexString = fmt.Sprintf(`^?/%s/(%s)/%s`, UsersPath, usernameRegexString, PublicKeyPath)
+ userPublicKeyPathRegex = regexp.MustCompile(userPublicKeyPathRegexString)
+
inboxPathRegexString = fmt.Sprintf(`^/?%s/(%s)/%s$`, UsersPath, usernameRegexString, InboxPath)
// inboxPathRegex parses a path that validates and captures the username part from eg /users/example_username/inbox
inboxPathRegex = regexp.MustCompile(inboxPathRegexString)