aboutsummaryrefslogtreecommitdiff
path: root/urls/urls.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--urls/urls.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/urls/urls.go b/urls/urls.go
index d2bfb4a..8b3a7fa 100644
--- a/urls/urls.go
+++ b/urls/urls.go
@@ -10,6 +10,10 @@ func linkTo(name, base string, path ...string) (*url.URL, error) {
if err != nil {
return nil, fmt.Errorf("could not build %s url: %w", name, err)
}
+ u, err = url.PathUnescape(u)
+ if err != nil {
+ return nil, fmt.Errorf("could not unescape %s url: %w", name, err)
+ }
uri, err := url.Parse(u)
if err != nil {
return nil, fmt.Errorf("could not parse %s url: %w", name, err)
@@ -29,6 +33,10 @@ func UrlProfile(name, domain string) (*url.URL, error) {
return linkTo("outbox", domain, "actors", name)
}
+func UrlProfileKey(name, domain string) (*url.URL, error) {
+ return linkTo("outbox", domain, "actors", name+"#main-key")
+}
+
func UrlFollowers(name, domain string) (*url.URL, error) {
return linkTo("outbox", domain, "actors", name, "followers")
}