Handle create requests but immediately throw an error that we ignore them
This commit is contained in:
parent
e8436f063e
commit
9eecf1c902
13
activitypub/inbox/create.go
Normal file
13
activitypub/inbox/create.go
Normal file
@ -0,0 +1,13 @@
|
||||
package inbox
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-fed/activity/streams/vocab"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func handleCreateRequest(c context.Context, activity vocab.ActivityStreamsCreate) error {
|
||||
iri := activity.GetJSONLDId().GetIRI().String()
|
||||
return errors.New("not handling create request of: " + iri)
|
||||
}
|
@ -24,14 +24,12 @@ func handle(request apmodels.InboxRequest) {
|
||||
log.Debugln("Error in attempting to verify request", err)
|
||||
return
|
||||
} else if !verified {
|
||||
log.Errorln("Request failed verification", err)
|
||||
log.Debugln("Request failed verification", err)
|
||||
return
|
||||
}
|
||||
|
||||
// c := context.WithValue(context.Background(), "account", request.ForLocalAccount) //nolint
|
||||
|
||||
if err := resolvers.Resolve(context.Background(), request.Body, handleUpdateRequest, handleFollowInboxRequest, handleLikeRequest, handleAnnounceRequest, handleUndoInboxRequest); err != nil {
|
||||
log.Errorln("resolver error:", err)
|
||||
if err := resolvers.Resolve(context.Background(), request.Body, handleUpdateRequest, handleFollowInboxRequest, handleLikeRequest, handleAnnounceRequest, handleUndoInboxRequest, handleCreateRequest); err != nil {
|
||||
log.Debugln("resolver error:", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user