We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31cef5f commit 499e2ebCopy full SHA for 499e2eb
test/mail/parsers/rfc_2822_test.exs
@@ -1027,6 +1027,18 @@ defmodule Mail.Parsers.RFC2822Test do
1027
defp parse_email(email, opts \\ []),
1028
do: email |> convert_crlf |> Mail.Parsers.RFC2822.parse(opts)
1029
1030
+ test "invalid content-type should not take infinite time" do
1031
+ message =
1032
+ parse_email("""
1033
+ Content-type: text/html; charset=us-ascii;a
1034
+ """)
1035
+
1036
+ assert message.headers["content-type"] == ["text/html", {"charset", "us-ascii"}]
1037
+ end
1038
1039
+ defp parse_email(email),
1040
+ do: email |> convert_crlf |> Mail.Parsers.RFC2822.parse()
1041
1042
defp parse_recipient(recipient),
1043
do: Mail.Parsers.RFC2822.parse_recipient_value(recipient)
1044
0 commit comments