diff --git a/lib/net/imap/response_parser.rb b/lib/net/imap/response_parser.rb index 91f8d14c..3535792b 100644 --- a/lib/net/imap/response_parser.rb +++ b/lib/net/imap/response_parser.rb @@ -1676,7 +1676,7 @@ def thread_nested def mailbox_data__status resp_name = label("STATUS"); SP! mbox_name = mailbox; SP! - lpar; attr = status_att_list; rpar + lpar; attr = peek_rpar? ? {} : status_att_list; rpar UntaggedResponse.new(resp_name, StatusData.new(mbox_name, attr), @str) end diff --git a/test/net/imap/fixtures/response_parser/status_responses.yml b/test/net/imap/fixtures/response_parser/status_responses.yml index 85581360..59ff251a 100644 --- a/test/net/imap/fixtures/response_parser/status_responses.yml +++ b/test/net/imap/fixtures/response_parser/status_responses.yml @@ -25,6 +25,15 @@ UIDVALIDITY: 1234 raw_data: "* STATUS INBOX (UIDNEXT 1 UIDVALIDITY 1234)\r\n" + test_status_response_empty_attribute_list: + :response: "* STATUS INBOX ()\r\n" + :expected: !ruby/struct:Net::IMAP::UntaggedResponse + name: STATUS + data: !ruby/struct:Net::IMAP::StatusData + mailbox: INBOX + attr: {} + raw_data: "* STATUS INBOX ()\r\n" + test_invalid_status_response_trailing_space: :comments: | [Bug #13649]