From 9a77f07db182576b1a79069d7ff6d18146c4c9e2 Mon Sep 17 00:00:00 2001 From: Naoki Kosaka Date: Sat, 10 Nov 2018 00:35:59 +0900 Subject: [PATCH] Add error handling for no signature request. --- decode.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/decode.go b/decode.go index 790be8d..9083227 100644 --- a/decode.go +++ b/decode.go @@ -20,7 +20,10 @@ func decodeActivity(r *http.Request) (*activitypub.Activity, *activitypub.Actor, r.Body.Read(body) // Verify HTTPSignature - verifier, _ := httpsig.NewVerifier(r) + verifier, err := httpsig.NewVerifier(r) + if err != nil { + return nil, nil, nil, err + } KeyID := verifier.KeyId() remoteActor, err := activitypub.RetrieveActor(KeyID) if err != nil {