diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-07 04:05:44 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-07 04:05:44 +0000 |
commit | 9be3aa1767681caf5a441336eaf6408979a26649 (patch) | |
tree | 3b53f8e8fa570e2efca04ab10d6da5ca2c58901c /test/net | |
parent | 0fce0545b607e1ac92457cc8523645c294c2d411 (diff) | |
download | ruby-9be3aa1767681caf5a441336eaf6408979a26649.tar.gz |
* lib/net/imap.rb (body_type_attachment): parse body type
"ATTACHMENT". [ruby-core:44849] [Bug #6397]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/imap/test_imap_response_parser.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb index b4d36c9091..0231ed436b 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -142,4 +142,14 @@ foo EOF assert_equal("foo\r\n", response.data.attr["RFC822"]) end + + # [Bug #6397] [ruby-core:44849] + def test_body_type_attachment + parser = Net::IMAP::ResponseParser.new + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* 980 FETCH (UID 2862 BODYSTRUCTURE ((("TEXT" "PLAIN" ("CHARSET" "iso-8859-1") NIL NIL "7BIT" 416 21 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "iso-8859-1") NIL NIL "7BIT" 1493 32 NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY" "Boundary_(ID_IaecgfnXwG5bn3x8lIeGIQ)") NIL NIL)("MESSAGE" "RFC822" ("NAME" "Fw_ ____ _____ ____.eml") NIL NIL "7BIT" 1980088 NIL ("ATTACHMENT" ("FILENAME" "Fw_ ____ _____ ____.eml")) NIL) "MIXED" ("BOUNDARY" "Boundary_(ID_eDdLc/j0mBIzIlR191pHjA)") NIL NIL)) +EOF + assert_equal("Fw_ ____ _____ ____.eml", + response.data.attr["BODYSTRUCTURE"].parts[1].body.param["FILENAME"]) + end end |