don't swallow unknown encodings

This commit is contained in:
Alexander Weinhold 2017-08-05 18:58:58 +02:00
parent d491e434a1
commit fb3a698210

View File

@ -75,6 +75,8 @@ func normalize(m []byte, encoding string) ([]byte, error) {
s, err = ioutil.ReadAll(quotedprintable.NewReader(strings.NewReader(string(m)))) s, err = ioutil.ReadAll(quotedprintable.NewReader(strings.NewReader(string(m))))
} else if encoding == "base64" { } else if encoding == "base64" {
s, err = ioutil.ReadAll(base64.NewDecoder(base64.StdEncoding, strings.NewReader(string(m)))) s, err = ioutil.ReadAll(base64.NewDecoder(base64.StdEncoding, strings.NewReader(string(m))))
} else {
s = m
} }
if err == io.ErrUnexpectedEOF { if err == io.ErrUnexpectedEOF {
err = nil err = nil