don't save large attachments that sneak in

This commit is contained in:
Ted Unangst 2019-07-04 18:47:45 -04:00
parent d2870d8207
commit 5d0fb4d41c
1 changed files with 4 additions and 0 deletions

View File

@ -180,6 +180,10 @@ func savedonk(url string, name, media string, localize bool) *Donk {
}
data = img.Data
media = "image/" + img.Format
} else if len(data) > 100000 {
log.Printf("not saving large attachment")
localize = false
data = []byte{}
}
}
saveit: