diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-23 00:12:46 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-23 00:16:01 +0200 |
commit | bf89d5c1808dec9e543b0a713bdb80d35d2e2ad2 (patch) | |
tree | 179967124c48a28903cbb2e45fb13c03bc676b9c | |
parent | 31481f8b851590110b73e1c46b7a20aac53641bd (diff) | |
download | mblaze-bf89d5c1808dec9e543b0a713bdb80d35d2e2ad2.tar.gz mblaze-bf89d5c1808dec9e543b0a713bdb80d35d2e2ad2.tar.xz mblaze-bf89d5c1808dec9e543b0a713bdb80d35d2e2ad2.zip |
mshow: render_mime: set a default mime type
-rw-r--r-- | mshow.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mshow.c b/mshow.c index 3684faf..2016db7 100644 --- a/mshow.c +++ b/mshow.c @@ -146,6 +146,8 @@ mime_action render_mime(int depth, struct message *msg, char *body, size_t bodylen) { char *ct = blaze822_hdr(msg, "content-type"); + if (!ct) + ct = "text/x-unknown"; char *mt = mimetype(ct); char *tlmt = tlmimetype(ct); char *filename = mime_filename(msg); @@ -230,7 +232,7 @@ reply_mime(int depth, struct message *msg, char *body, size_t bodylen) { (void) depth; - char *ct = blaze822_hdr(msg, "Content-Type"); + char *ct = blaze822_hdr(msg, "content-type"); char *mt = mimetype(ct); char *tlmt = tlmimetype(ct); @@ -260,6 +262,8 @@ list_mime(int depth, struct message *msg, char *body, size_t bodylen) (void) body; char *ct = blaze822_hdr(msg, "content-type"); + if (!ct) + ct = "text/x-unknown"; char *mt = mimetype(ct); char *filename = mime_filename(msg); |