Browse Source

Add a sanity check to make sure the actor IRI exists

pull/1715/head
Gabe Kangas 4 years ago
parent
commit
65f0673dba
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
  1. 4
      activitypub/inbox/worker.go

4
activitypub/inbox/worker.go

@ -71,6 +71,10 @@ func Verify(request *http.Request) (bool, error) { @@ -71,6 +71,10 @@ func Verify(request *http.Request) (bool, error) {
return false, errors.Wrap(err, "failed to resolve actor from IRI to fetch key")
}
if actor.ActorIri == nil {
return false, errors.New("actor IRI is empty")
}
// Test to see if the actor is in the list of blocked federated domains.
if isBlockedDomain(actor.ActorIri.Hostname()) {
return false, errors.New("domain is blocked")

Loading…
Cancel
Save