diff options
author | Julio Capote <jcapote@gmail.com> | 2023-01-01 22:00:31 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2023-01-01 22:00:31 +0000 |
commit | b5591aa8deed658cd3bb032d4800d7eb1c5b8a3f (patch) | |
tree | 9ad828d39222b5fb0532e2cd077a6efe6d3acc54 /urls/urls.go | |
parent | af4dc7f3f05fad8fe13edf0173a6dee5e4148bd3 (diff) | |
download | communique-b5591aa8deed658cd3bb032d4800d7eb1c5b8a3f.tar.gz |
working note lookups
Diffstat (limited to 'urls/urls.go')
-rw-r--r-- | urls/urls.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/urls/urls.go b/urls/urls.go index 98ba922..91e0b37 100644 --- a/urls/urls.go +++ b/urls/urls.go @@ -7,7 +7,8 @@ import ( ) func UrlInbox(name, domain string) (*url.URL, error) { - u, err := url.Parse(path.Join("https://", domain, "actors", name, "inbox")) + u, err := url.Parse(path.Join(domain, "actors", name, "inbox")) + u.Scheme = "https" if err != nil { return nil, fmt.Errorf("could not build inbox url: %w", err) } @@ -15,7 +16,8 @@ func UrlInbox(name, domain string) (*url.URL, error) { } func UrlOutbox(name, domain string) (*url.URL, error) { - u, err := url.Parse(path.Join("https://", domain, "actors", name, "outbox")) + u, err := url.Parse(path.Join(domain, "actors", name, "outbox")) + u.Scheme = "https" if err != nil { return nil, fmt.Errorf("could not build outbox url: %w", err) } @@ -23,7 +25,8 @@ func UrlOutbox(name, domain string) (*url.URL, error) { } func UrlActivity(name, domain, id string) (*url.URL, error) { - u, err := url.Parse(path.Join(domain, "actors", name, "outbox", id, "activity")) + u, err := url.Parse(path.Join(domain, "actors", name, "activity", id)) + u.Scheme = "https" if err != nil { return nil, fmt.Errorf("could not build activity url: %w", err) } @@ -31,7 +34,8 @@ func UrlActivity(name, domain, id string) (*url.URL, error) { } func UrlNote(name, domain, id string) (*url.URL, error) { - u, err := url.Parse(path.Join("https://", domain, "actors", name, "outbox", id, "note")) + u, err := url.Parse(path.Join(domain, "actors", name, "activity", id, "note")) + u.Scheme = "https" if err != nil { return nil, fmt.Errorf("could not build note url: %w", err) } @@ -40,6 +44,7 @@ func UrlNote(name, domain, id string) (*url.URL, error) { func UrlOutboxPage(name, domain string) (*url.URL, error) { u, err := UrlOutbox(name, domain) + u.Scheme = "https" if err != nil { return nil, fmt.Errorf("could not build outbox page url: %w", err) } |