Changes
1 changed files (+10/-3)
-
-
@@ -35,7 +35,8 @@ type Client interface {// UserAgent value that the client uses when performing requests var UserAgent = "activitypub-go-http-client" var HeaderAccept = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` var ContentTypeJsonLD = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` var ContentTypeActivityJson = `application/activity+json` // ErrorLogger var ErrorLogger LogFn = func(el ...interface{}) {}
-
@@ -123,8 +124,14 @@ func (c *client) req(method string, url string, body io.Reader) (*http.Request,return req, err } req.Header.Set("User-Agent", UserAgent) req.Header.Set("Accept", HeaderAccept) //req.Header.Set("Cache-Control", "no-cache") if method == http.MethodGet { req.Header.Add("Accept", ContentTypeJsonLD) req.Header.Add("Accept", ContentTypeActivityJson) req.Header.Add("Accept", "application/json") } if method == http.MethodPost { req.Header.Set("Content-Type", ContentTypeJsonLD) } if err = c.signFn(req); err != nil { err := errorf(as.IRI(req.URL.String()), "Unable to sign request (method %q, previous error: %s)", req.Method, err) return req, err
-