diff options
Diffstat (limited to 'registry/registry.go')
-rw-r--r-- | registry/registry.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/registry/registry.go b/registry/registry.go index 01d92c7..f1ec426 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -272,6 +272,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol request.Header.Add("Digest", "SHA-256="+digestHeader) request.Header.Add("Content-Type", "application/activity+json") + signedString := fmt.Sprintf("(request-target): post %s\ncontent-type: %s\ndate: %s\ndigest: %s\nhost: %s", url.Path, request.Header.Get("Content-Type"), date, digestHeader, url.Host) + r.log.With( "type", "delivery", @@ -279,6 +281,9 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol "payload", payload, ).With( + "signature string", + signedString, + ).With( "date", request.Header.Get("date"), ).With( @@ -286,10 +291,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol request.Header.Get("host"), ).Debugf("signing request") - signed_string := fmt.Sprintf("(request-target): post %s\ncontent-type: %s\ndate: %s\ndigest: %s\nhost: %s", url.Path, request.Header.Get("Content-Type"), date, digestHeader, url.Host) - digest := sha256.New() - digest.Write([]byte(signed_string)) + digest.Write([]byte(signedString)) digestBytes := digest.Sum(nil) r.mu.Lock() |