built-in genuine image checker based on byte headers

This commit is contained in:
Wouter Groeneveld 2021-04-22 16:03:03 +02:00
parent f90af3b076
commit f964c7442f
1 changed files with 2 additions and 4 deletions

View File

@ -21,6 +21,8 @@ type Receiver struct {
}
var (
titleRegexp = regexp.MustCompile(`<title>(.*?)<\/title>`)
errPicUnableToDownload = errors.New("Unable to download author picture")
errPicNoRealImage = errors.New("Downloaded author picture is not a real image")
errPicUnableToSave = errors.New("Unable to save downloaded author picture")
@ -86,10 +88,6 @@ func (recv *Receiver) parseBodyAsIndiewebSite(hEntry *microformats.Microformat,
}
}
var (
titleRegexp = regexp.MustCompile(`<title>(.*?)<\/title>`)
)
func (recv *Receiver) parseBodyAsNonIndiewebSite(body string, wm mf.Mention) *mf.IndiewebData {
title := nonIndiewebTitle(body, wm)
return &mf.IndiewebData{