|
|
@ -494,7 +494,7 @@ func makeActivityPost(hostName string, p *activitystreams.Person, url string, m |
|
|
|
|
|
|
|
|
|
|
|
r, _ := http.NewRequest("POST", url, bytes.NewBuffer(b)) |
|
|
|
r, _ := http.NewRequest("POST", url, bytes.NewBuffer(b)) |
|
|
|
r.Header.Add("Content-Type", "application/activity+json") |
|
|
|
r.Header.Add("Content-Type", "application/activity+json") |
|
|
|
r.Header.Set("User-Agent", "Go ("+serverSoftware+"/"+softwareVer+"; +"+hostName+")") |
|
|
|
r.Header.Set("User-Agent", ServerUserAgent(hostName)) |
|
|
|
h := sha256.New() |
|
|
|
h := sha256.New() |
|
|
|
h.Write(b) |
|
|
|
h.Write(b) |
|
|
|
r.Header.Add("Digest", "SHA-256="+base64.StdEncoding.EncodeToString(h.Sum(nil))) |
|
|
|
r.Header.Add("Digest", "SHA-256="+base64.StdEncoding.EncodeToString(h.Sum(nil))) |
|
|
@ -544,7 +544,7 @@ func resolveIRI(hostName, url string) ([]byte, error) { |
|
|
|
|
|
|
|
|
|
|
|
r, _ := http.NewRequest("GET", url, nil) |
|
|
|
r, _ := http.NewRequest("GET", url, nil) |
|
|
|
r.Header.Add("Accept", "application/activity+json") |
|
|
|
r.Header.Add("Accept", "application/activity+json") |
|
|
|
r.Header.Set("User-Agent", "Go ("+serverSoftware+"/"+softwareVer+"; +"+hostName+")") |
|
|
|
r.Header.Set("User-Agent", ServerUserAgent(hostName)) |
|
|
|
|
|
|
|
|
|
|
|
if debugging { |
|
|
|
if debugging { |
|
|
|
dump, err := httputil.DumpRequestOut(r, true) |
|
|
|
dump, err := httputil.DumpRequestOut(r, true) |
|
|
|