diff options
author | Anthony Wang | 2022-06-17 11:10:51 -0500 |
---|---|---|
committer | Anthony Wang | 2022-06-17 11:10:51 -0500 |
commit | 8e6f3fbf4650ac7e9100ff8096719d6698266794 (patch) | |
tree | 6b565eb3b753577540c4d6fe92946f9709e18dc7 | |
parent | 7e1784fd3f3535c9535494ea78a8803a01692f09 (diff) |
Update go-ap to fix empty liked collection and removed unneeded HTTP headers
-rw-r--r-- | go.mod | 6 | ||||
-rw-r--r-- | go.sum | 6 | ||||
-rw-r--r-- | modules/activitypub/client.go | 1 | ||||
-rw-r--r-- | routers/api/v1/activitypub/reqsignature.go | 2 |
4 files changed, 9 insertions, 6 deletions
@@ -27,7 +27,7 @@ require ( github.com/emirpasic/gods v1.18.1 github.com/ethantkoenig/rupture v1.0.1 github.com/gliderlabs/ssh v0.3.4 - github.com/go-ap/activitypub v0.0.0-20220606130025-d23c21aea068 + github.com/go-ap/activitypub v0.0.0-20220615144428-48208c70483b github.com/go-chi/chi/v5 v5.0.7 github.com/go-chi/cors v1.2.1 github.com/go-enry/go-enry/v2 v2.8.2 @@ -161,8 +161,8 @@ require ( github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/fullstorydev/grpcurl v1.8.1 // indirect github.com/fxamacker/cbor/v2 v2.4.0 // indirect - github.com/go-ap/errors v0.0.0-20220529131844-4c7dbeabb369 // indirect - github.com/go-ap/jsonld v0.0.0-20200327122108-fafac2de2660 // indirect + github.com/go-ap/errors v0.0.0-20220615144307-e8bc4a40ae9f // indirect + github.com/go-ap/jsonld v0.0.0-20220615144122-1d862b15410d // indirect github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect github.com/go-enry/go-oniguruma v1.2.1 // indirect github.com/go-git/gcfg v1.5.0 // indirect @@ -462,10 +462,16 @@ github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-ap/activitypub v0.0.0-20220606130025-d23c21aea068 h1:Xzxc/HjHFAwJTieEWcC1SjBHVBq+Y1xPgk7WWcG3sjs= github.com/go-ap/activitypub v0.0.0-20220606130025-d23c21aea068/go.mod h1:h5U5YGW+z4mVF3XH6bKfBmsJinRVuKpS23uYqJfGSbo= +github.com/go-ap/activitypub v0.0.0-20220615144428-48208c70483b h1:+RjYfEfoZdM3wHFs752dlOpGaoRhwRRyQxjajg08LcQ= +github.com/go-ap/activitypub v0.0.0-20220615144428-48208c70483b/go.mod h1:DE3vvc6Didgfd3k7M1Mos6qMDFNmMrxJmYVMHG9h9Io= github.com/go-ap/errors v0.0.0-20220529131844-4c7dbeabb369 h1:z09Qf9XB5lU3NBZnrsN9VJqrIgwKLrsBVUgrir4zL9A= github.com/go-ap/errors v0.0.0-20220529131844-4c7dbeabb369/go.mod h1:yENIaXEY5AiFL/qGTBBcPuk40I5SLyZzwrQj2ID5PHQ= +github.com/go-ap/errors v0.0.0-20220615144307-e8bc4a40ae9f h1:kJhGo4NApJP0Lt9lkJnfmuTnRWVFbCynY0kiTxpPUR4= +github.com/go-ap/errors v0.0.0-20220615144307-e8bc4a40ae9f/go.mod h1:KHkKFKZvc05lr79+RGoq/zG8YjWi3+FK60Bxd+mpCew= github.com/go-ap/jsonld v0.0.0-20200327122108-fafac2de2660 h1:AUG8+r0Q/zbNUAi5CWVBK5oUhOZDX3Kkr+oWURaJIfU= github.com/go-ap/jsonld v0.0.0-20200327122108-fafac2de2660/go.mod h1:jyveZeGw5LaADntW+UEsMjl3IlIwk+DxlYNsbofQkGA= +github.com/go-ap/jsonld v0.0.0-20220615144122-1d862b15410d h1:Z/oRXMlZHjvjIqDma1FrIGL3iE5YL7MUI0bwYEZ6qbA= +github.com/go-ap/jsonld v0.0.0-20220615144122-1d862b15410d/go.mod h1:jyveZeGw5LaADntW+UEsMjl3IlIwk+DxlYNsbofQkGA= github.com/go-asn1-ber/asn1-ber v1.5.4 h1:vXT6d/FNDiELJnLb6hGNa309LMsrCoYFvpwHDF0+Y1A= github.com/go-asn1-ber/asn1-ber v1.5.4/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-chi/chi/v5 v5.0.1/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= diff --git a/modules/activitypub/client.go b/modules/activitypub/client.go index 46b8c675b..923bc4ea4 100644 --- a/modules/activitypub/client.go +++ b/modules/activitypub/client.go @@ -103,7 +103,6 @@ func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) return } req.Header.Add("Content-Type", ActivityStreamsContentType) - req.Header.Add("Accept-Charset", "utf-8") req.Header.Add("Date", CurrentTime()) signer, _, err := httpsig.NewSigner(c.algs, c.digestAlg, c.postHeaders, httpsig.Signature, httpsigExpirationTime) if err != nil { diff --git a/routers/api/v1/activitypub/reqsignature.go b/routers/api/v1/activitypub/reqsignature.go index 316d66cd8..08e6b57e2 100644 --- a/routers/api/v1/activitypub/reqsignature.go +++ b/routers/api/v1/activitypub/reqsignature.go @@ -47,8 +47,6 @@ func getPublicKeyFromResponse(b []byte, keyID *url.URL) (p crypto.PublicKey, err func fetch(iri *url.URL) (b []byte, err error) { req := httplib.NewRequest(iri.String(), http.MethodGet) req.Header("Accept", activitypub.ActivityStreamsContentType) - req.Header("Accept-Charset", "utf-8") - req.Header("Date", activitypub.CurrentTime()) resp, err := req.Response() if err != nil { return |