From 2b0b346c2c737c7866799e60740c43e79fe28649 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Thu, 5 Jan 2023 11:21:28 -0500 Subject: try this --- registry/registry.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'registry/registry.go') diff --git a/registry/registry.go b/registry/registry.go index eb53171..737ae5b 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -13,7 +13,6 @@ import ( "net/url" "strings" "sync" - "time" "git.capotej.com/capotej/communique/config" "git.capotej.com/capotej/communique/models" @@ -251,7 +250,7 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl *url.URL, follow vocab.Act privKey := &keypair.PrivateKey request, err := http.NewRequest("POST", url.String(), bytes.NewBuffer(jsonData)) - request.Header.Set("Date", time.Now().Format(http.TimeFormat)) + // request.Header.Set("Date", time.Now().Format(http.TimeFormat)) request.Header.Set("Content-Type", "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") request.Header.Set("Host", url.Host) @@ -276,8 +275,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl *url.URL, follow vocab.Act prefs := []httpsig.Algorithm{httpsig.RSA_SHA256} digestAlgorithm := httpsig.DigestSha256 // The "Date" and "Digest" headers must already be set on r, as well as r.URL. - headersToSign := []string{httpsig.RequestTarget, "host", "digest", "content-type"} - signer, _, err := httpsig.NewSigner(prefs, digestAlgorithm, headersToSign, httpsig.Signature, 0) // expires in 5 mins + headersToSign := []string{httpsig.RequestTarget, "host", "date", "digest", "content-type"} + signer, _, err := httpsig.NewSigner(prefs, digestAlgorithm, headersToSign, httpsig.Signature, 0) if err != nil { return err } -- cgit v1.2.3