all repos — navani @ f31c9400f01882bebd7c151acfa37619a33d446b

forlater's primary mail processing service

Add exceptions for non text/html content types
Anirudh Oppiliappan x@icyphox.sh
Thu, 04 Nov 2021 11:24:49 +0530
commit

f31c9400f01882bebd7c151acfa37619a33d446b

parent

2928def670071abf79a9dd21ecbaa532149405f4

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M main.gomain.go

@@ -38,7 +38,7 @@ log.Printf("reader fetch: %v\n", err)

} article, err := reader.Readable(resp.Body, parsedURL) - if (err == nil) && (resp.MIMEType == "text/html") { + if (err == nil) && (resp.MIMEType == "text/html" || resp.MIMEType == "text/plain" || resp.MIMEType == "html") { err = mail.SendArticle(&article, m.From, true) if err != nil { log.Printf("error sending mail to: %s: %v\n", m.From, err)