diff options
author | Julio Capote <jcapote@gmail.com> | 2023-01-04 02:10:38 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2023-01-04 02:10:38 +0000 |
commit | b74190b22474986c20149b3a4a527a684f4ee3ce (patch) | |
tree | c61550b0990b946a5db41c0177f705e6ecc87744 /urls/urls.go | |
parent | 8f83ac669faa22a684176f8ae796f088f4cde8b6 (diff) | |
download | communique-b74190b22474986c20149b3a4a527a684f4ee3ce.tar.gz |
render publickeypem in actor endpoints
Diffstat (limited to '')
-rw-r--r-- | urls/urls.go | 8 |
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") } |