Change how key for mentions stored

kcoram/uplift
Jan-Lukas Else 2019-12-13 08:35:49 +01:00
parent 6c48c016cc
commit ea0400ab9d
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ func saveWebmention(mention *Mention) (err error) {
if err != nil { if err != nil {
return errors.New("failed to marshal json before committing") return errors.New("failed to marshal json before committing")
} }
filePath := fmt.Sprintf("data/mentions/%x/%x.json", md5.Sum([]byte(mention.Target)), md5.Sum([]byte(mention.Source))) filePath := fmt.Sprintf("data/mentions/%x/%x.json", md5.Sum([]byte(strings.ReplaceAll(mention.Target, "/", ""))), md5.Sum([]byte(mention.Source)))
err = UpdateFile(filePath, string(bytesRepresentation), "New webmention from "+mention.Source) err = UpdateFile(filePath, string(bytesRepresentation), "New webmention from "+mention.Source)
return return
} }