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
1 change: 1 addition & 0 deletions lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ def self.encode_www_form(enum, enc=nil)
str << '='
str << encode_www_form_component(w, enc)
end
str
end.join('&')
else
str = encode_www_form_component(k, enc)
Expand Down
5 changes: 5 additions & 0 deletions test/uri/test_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class Foo
end
end


def test_encode_www_form_preserves_nil_array_values
assert_equal("foo&foo=a&foo", URI.encode_www_form(foo: [nil, "a", nil]))
end

def test_fallback_constants
EnvUtil.suppress_warning do
assert_raise(NameError) { URI::FOO }
Expand Down