Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/net/smtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ def capabilities
h = {}
@string.lines.drop(1).each do |line|
k, *v = line[4..-1].split(' ')
h[k] = v
h[k&.upcase] = v
end
h
end
Expand Down
9 changes: 9 additions & 0 deletions test/net/smtp/test_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ def test_capabilities_value
assert_equal ['1234'], res.capabilities['SIZE']
end

def test_capabilities_normalize_keyword_case_only
res = Response.parse("250-fixture\n250-smtputf8\n250 size MiXeD\n")
assert_equal({
"SMTPUTF8" => [],
"SIZE" => ["MiXeD"],
},
res.capabilities)
end

def test_capabilities_multi
res = Response.parse("250-ubuntu-desktop\n250-SIZE 1 2 3\n250 DSN\n")
assert_equal %w{1 2 3}, res.capabilities['SIZE']
Expand Down