summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-17 11:58:09 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-17 11:58:09 +0000
commit53127c2410c29f7cc942a76baa7be97ba65aafda (patch)
tree2216e7b11eb1b4b2d43602a3b4327122c225bcfb /test
parent95d3671e94515fa83de975604fd1a03fa79f081b (diff)
erb.rb: Don't encode tilde in #url_encode
Based on patch by madeofcode (Mark Dodwell). [ruby-core:46168] [Bug #6696] [Fix GH-54] `~` is a unreserved character. https://tools.ietf.org/html/rfc3986#section-2.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/erb/test_erb.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 6a07f9c5cb..7a92de3630 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -464,6 +464,10 @@ EOS
assert_equal("%A5%B5%A5%F3%A5%D7%A5%EB",
ERB::Util.url_encode("\xA5\xB5\xA5\xF3\xA5\xD7\xA5\xEB".force_encoding("EUC-JP")))
+
+ assert_equal("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",
+ ERB::Util.url_encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"),
+ "should not escape any unreserved characters, as per RFC3986 Section 2.3")
end
def test_percent_after_etag