diff options
author | Julio Capote <jcapote@gmail.com> | 2023-01-05 16:21:28 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2023-01-05 16:21:28 +0000 |
commit | 2b0b346c2c737c7866799e60740c43e79fe28649 (patch) | |
tree | 09ee58b4998cf9df0834c3678994ebef510c57ef /registry/registry.go | |
parent | 45a05dbdc9d0bc7c3a53a339dcf91080e4f0ec3d (diff) | |
download | communique-2b0b346c2c737c7866799e60740c43e79fe28649.tar.gz |
try this
Diffstat (limited to 'registry/registry.go')
-rw-r--r-- | registry/registry.go | 7 |
1 files changed, 3 insertions, 4 deletions
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 } |