Permalink
Browse files

[fix] mime: fix for inline html recognition

  • Loading branch information...
1 parent 7f0d2d2 commit aecf6997861dfdfe7149f7800165924d9eef8083 @Aqua-Ye Aqua-Ye committed Apr 18, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 stdlib/web/mail/mime.opa
View
@@ -303,13 +303,18 @@ Mime = {{
| "multipart/related" ->
boundary = Header.extract_value("boundary", content_type_list)
multipart(body, boundary)
- | "text/html" -> {html=Xhtml.of_string(decoded_body)}
| _ ->
match Header.find("Content-Disposition", headers)
- {none} -> {plain=decoded_body}
+ {none} ->
+ if content_type == "text/html" then
+ {html=Xhtml.of_string(decoded_body)}
+ else
+ {plain=decoded_body}
{some=cd} ->
if content_type == "text/plain" && cd == "inline" then
{plain=decoded_body}
+ else if content_type == "text/html" && cd == "inline" then
+ {html=Xhtml.of_string(decoded_body)}
else
filename = String.explode(";", cd)
|> List.map(String.trim, _)

0 comments on commit aecf699

Please sign in to comment.