diff options
author | Anthony Wang | 2022-04-13 09:05:24 -0500 |
---|---|---|
committer | Anthony Wang | 2022-04-13 09:05:24 -0500 |
commit | 5139b3dc194fa2cd6f36cf9fbbf62d75d7bd1f55 (patch) | |
tree | b1d545518ae7605bf9c94f9fb4a7db22b4c5c7b0 | |
parent | 7ea5e108a58540a07390a26d40d9e36db8781ec2 (diff) |
Use named constant for httpsigExpirationTime
-rw-r--r-- | modules/activitypub/client.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/activitypub/client.go b/modules/activitypub/client.go index 9cd9f0dc3..a11284dbc 100644 --- a/modules/activitypub/client.go +++ b/modules/activitypub/client.go @@ -24,6 +24,7 @@ import ( const ( // ActivityStreamsContentType const ActivityStreamsContentType = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` + httpsigExpirationTime = 60 ) func containsRequiredHTTPHeaders(method string, headers []string) error { @@ -109,7 +110,7 @@ func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) req.Header.Add("Accept-Charset", "utf-8") req.Header.Add("Date", fmt.Sprintf("%s GMT", c.clock.Now().UTC().Format(time.RFC1123))) - signer, _, err := httpsig.NewSigner(c.algs, c.digestAlg, c.postHeaders, httpsig.Signature, 60) + signer, _, err := httpsig.NewSigner(c.algs, c.digestAlg, c.postHeaders, httpsig.Signature, httpsigExpirationTime) if err != nil { return } |