aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/html-scanner/sanitizer_test.rb
diff options
context:
space:
mode:
authorTimothy N. Tsvetkov <timothy.tsvetkov@gmail.com>2010-11-24 00:17:05 +0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-12-30 22:43:43 -0200
commite5b84fd72358deddd29c515aacab7edf2643908e (patch)
tree9aa4c81e85567bc9082d2b251d0771c96dabb155 /actionpack/test/template/html-scanner/sanitizer_test.rb
parent573fd39e22b3d278457fa764c107095808b361fe (diff)
downloadrails-e5b84fd72358deddd29c515aacab7edf2643908e.tar.gz
rails-e5b84fd72358deddd29c515aacab7edf2643908e.tar.bz2
rails-e5b84fd72358deddd29c515aacab7edf2643908e.zip
ActionController::Base.helpers.sanitize ignores case in protocol
[#6044 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack/test/template/html-scanner/sanitizer_test.rb')
-rw-r--r--actionpack/test/template/html-scanner/sanitizer_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/html-scanner/sanitizer_test.rb b/actionpack/test/template/html-scanner/sanitizer_test.rb
index 3e80317b30..fcc3782f04 100644
--- a/actionpack/test/template/html-scanner/sanitizer_test.rb
+++ b/actionpack/test/template/html-scanner/sanitizer_test.rb
@@ -130,6 +130,13 @@ class SanitizerTest < ActionController::TestCase
assert sanitizer.send(:contains_bad_protocols?, 'src', "#{proto}://bad")
end
end
+
+ def test_should_accept_good_protocols_ignoring_case
+ sanitizer = HTML::WhiteListSanitizer.new
+ HTML::WhiteListSanitizer.allowed_protocols.each do |proto|
+ assert !sanitizer.send(:contains_bad_protocols?, 'src', "#{proto.capitalize}://good")
+ end
+ end
def test_should_accept_good_protocols
sanitizer = HTML::WhiteListSanitizer.new