From 3595c8163cb0414f00b2f3f9d86290784124c899 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 15 Nov 2018 17:05:33 -0500 Subject: [PATCH] Use Accept ID on blog's origin instead of the requesting user's. This closes #16 --- activitypub.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/activitypub.go b/activitypub.go index 502e59a..1acd41f 100644 --- a/activitypub.go +++ b/activitypub.go @@ -12,6 +12,7 @@ import ( "github.com/writeas/activity/streams" "github.com/writeas/httpsig" "github.com/writeas/impart" + "github.com/writeas/nerds/store" "github.com/writeas/web-core/activitypub" "github.com/writeas/web-core/activitystreams" "github.com/writeas/web-core/log" @@ -259,9 +260,10 @@ func handleFetchCollectionInbox(app *app, w http.ResponseWriter, r *http.Request if followID == nil { log.Error("Didn't resolve follow ID") } else { - acceptID, err := url.Parse(followID.String() + "#accept") + aID := c.FederatedAccount() + "#accept-" + store.GenerateFriendlyRandomString(20) + acceptID, err := url.Parse(aID) if err != nil { - log.Error("Couldn't parse generated Accept URL '%s': %v", followID.String()+"#accept", err) + log.Error("Couldn't parse generated Accept URL '%s': %v", aID, err) } a.SetId(acceptID) }