aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-07-05 14:45:19 -0700
committerJeremy Evans <code@jeremyevans.net>2019-10-08 07:30:55 -0700
commit7909f06212ae8df6ba7203f8152292a190b2b33a (patch)
tree339f267dae1220e0c60b74bfb560371a88869833 /test/uri
parent8feb8c9bb7e9036ee2014b0f532677635a16893e (diff)
downloadruby-7909f06212ae8df6ba7203f8152292a190b2b33a.tar.gz
Check for invalid hex escapes in URI#query=
Fixes [Bug #11275]
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_parser.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/uri/test_parser.rb b/test/uri/test_parser.rb
index 088628a3fb..b13a26ca84 100644
--- a/test/uri/test_parser.rb
+++ b/test/uri/test_parser.rb
@@ -40,6 +40,11 @@ class URI::TestParser < Test::Unit::TestCase
uri_to_ary(u1))
end
+ def test_parse_query_pct_encoded
+ assert_equal('q=%32!$&-/?.09;=:@AZ_az~', URI.parse('https://www.example.com/search?q=%32!$&-/?.09;=:@AZ_az~').query)
+ assert_raise(URI::InvalidURIError) { URI.parse('https://www.example.com/search?q=%XX') }
+ end
+
def test_raise_bad_uri_for_integer
assert_raise(URI::InvalidURIError) do
URI.parse(1)