Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[enhance] mime: greatly improved multipart parsing

  • Loading branch information...
commit 79b01e6eb5fdf4066b06b25ab110e58ab9c02d40 1 parent 0c2fd2a
Frederic Ye Aqua-Ye authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 stdlib/web/mail/mime.opa
8 stdlib/web/mail/mime.opa
View
@@ -200,17 +200,17 @@ Mime = {{
@private Multipart = {{
parser(b:string) =
+ not_double_dash = parser !"--" !crlf_parser . -> void
delimiter =
- parser crlf_parser? (!("--"|crlf_parser) .)* "--" Parser.of_string(b) -> void
+ parser crlf_parser? not_double_dash* "--" "{b}" -> void
close_delimiter =
parser delimiter "--" -> void
body_part =
- parser bp=(!(delimiter|close_delimiter) .)* ->
- Text.to_string(Text.ltconcat(bp))
+ parser bp=((!delimiter Rule.full_line)*) -> Text.to_string(bp)
encapsulation =
parser delimiter crlf_parser content=body_part -> content
parser
- | (!delimiter .)* parts=encapsulation+ close_delimiter (.*) ->
+ | (!delimiter .)* parts=encapsulation+ close_delimiter .* ->
List.map(content ->
match parse_entity(content)
{some=part} -> part
Please sign in to comment.
Something went wrong with that request. Please try again.