I meant develop, not master

This commit is contained in:
Donald Feury 2021-02-24 23:57:35 -05:00
parent 4c0fcdf7c6
commit ebdb932090
1 changed files with 9 additions and 3 deletions

View File

@ -397,7 +397,9 @@ func handleFetchCollectionInbox(app *App, w http.ResponseWriter, r *http.Request
go func() { go func() {
if to == nil { if to == nil {
log.Error("No to! %v", err) if debugging {
log.Error("No `to` value!")
}
return return
} }
@ -492,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)))
@ -542,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)
@ -697,6 +699,10 @@ func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error {
// I don't believe we'd ever have too many mentions in a single post that this // I don't believe we'd ever have too many mentions in a single post that this
// could become a burden. // could become a burden.
remoteUser, err := getRemoteUser(app, tag.HRef) remoteUser, err := getRemoteUser(app, tag.HRef)
if err != nil {
log.Error("Unable to find remote user %s. Skipping: %v", tag.HRef, err)
continue
}
err = makeActivityPost(app.cfg.App.Host, actor, remoteUser.Inbox, activity) err = makeActivityPost(app.cfg.App.Host, actor, remoteUser.Inbox, activity)
if err != nil { if err != nil {
log.Error("Couldn't post! %v", err) log.Error("Couldn't post! %v", err)