summaryrefslogtreecommitdiff
path: root/test/uri
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-18 18:58:13 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-18 18:58:13 +0000
commit53fdb30e7f83fcaacb480a1e7c08a9288cd30bd7 (patch)
tree3c23f9d9334cd077d63b2616d275a5462ab2ffa5 /test/uri
parent2849ee5d18360f26b55643a2643a1c597376865d (diff)
* lib/uri/common.rb (URI.decode_www_form): scrub string if decoded
bytes are invalid for the encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_common.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb
index a72d7bf9be..65a92f3868 100644
--- a/test/uri/test_common.rb
+++ b/test/uri/test_common.rb
@@ -135,6 +135,8 @@ class TestCommon < Test::Unit::TestCase
assert_raise(ArgumentError){URI.decode_www_form("\u3042")}
assert_equal([%w[a 1], ["\u3042", "\u6F22"]],
URI.decode_www_form("a=1&%E3%81%82=%E6%BC%A2"))
+ assert_equal([%w[a 1], ["\uFFFD%8", "\uFFFD"]],
+ URI.decode_www_form("a=1&%E3%81%8=%E6%BC"))
assert_equal([%w[?a 1], %w[a 2]], URI.decode_www_form("?a=1&a=2"))
assert_equal([], URI.decode_www_form(""))
assert_equal([%w[% 1]], URI.decode_www_form("%=1"))