From 73c7f2de1490011027d4780da3891d34ae635a79 Mon Sep 17 00:00:00 2001 From: Jacob Burkhart & Josh Lane Date: Thu, 22 Sep 2011 15:35:44 -0700 Subject: [PATCH] test for parameter escaping --- test/filter_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/filter_test.rb b/test/filter_test.rb index 031af9ef..57f4d01c 100644 --- a/test/filter_test.rb +++ b/test/filter_test.rb @@ -97,6 +97,17 @@ class BeforeFilterTest < Test::Unit::TestCase assert_equal 'cool', body end + it "properly unescapes parameters" do + mock_app { + before { @foo = params['foo'] } + get('/foo') { @foo } + } + + get '/foo?foo=bar%3Abaz%2Fbend' + assert ok? + assert_equal 'bar:baz/bend', body + end + it "runs filters defined in superclasses" do base = Class.new(Sinatra::Base) base.before { @foo = 'hello from superclass' }