From b74190b22474986c20149b3a4a527a684f4ee3ce Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Tue, 3 Jan 2023 21:10:38 -0500 Subject: render publickeypem in actor endpoints --- urls/urls.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'urls') 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") } -- cgit v1.2.3