Archived
1
0

Merge pull request #172 from cathugger/master

srnd: use text/plain as default type
This commit is contained in:
Jeff 2018-12-23 06:47:55 -05:00 committed by GitHub
commit 7b64d2eeae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -642,7 +642,11 @@ func read_message_body(body io.Reader, hdr map[string][]string, store ArticleSto
} else if err == nil { } else if err == nil {
hdr := part.Header hdr := part.Header
// get content type of part // get content type of part
part_type := hdr.Get("Content-Type") part_type := strings.TrimSpace(hdr.Get("Content-Type"))
if part_type == "" {
// default if unspecified
part_type = "text/plain"
}
// parse content type // parse content type
media_type, _, err = mime.ParseMediaType(part_type) media_type, _, err = mime.ParseMediaType(part_type)
if err == nil { if err == nil {