From fb0c600e3a96bf7545e2b35af58ade1fef8f4d81 Mon Sep 17 00:00:00 2001 From: cathugger Date: Sun, 23 Dec 2018 08:34:15 +0200 Subject: [PATCH] srnd: use text/plain as default type otherwise it fails to parse valid messages --- contrib/backends/srndv2/src/srnd/store.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/store.go b/contrib/backends/srndv2/src/srnd/store.go index 8bd1c3d..6e553a4 100644 --- a/contrib/backends/srndv2/src/srnd/store.go +++ b/contrib/backends/srndv2/src/srnd/store.go @@ -642,7 +642,11 @@ func read_message_body(body io.Reader, hdr map[string][]string, store ArticleSto } else if err == nil { hdr := part.Header // 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 media_type, _, err = mime.ParseMediaType(part_type) if err == nil {