summary refs log tree commit
path: root/test/spec_utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec_utils.rb')
-rw-r--r--test/spec_utils.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/spec_utils.rb b/test/spec_utils.rb
index 06ed5636..c2d479f9 100644
--- a/test/spec_utils.rb
+++ b/test/spec_utils.rb
@@ -134,6 +134,18 @@ describe Rack::Utils do
     }.should.not.raise
   end
 
+  should "raise an exception if the params are too deep" do
+    len = Rack::Utils.param_depth_limit
+
+    lambda {
+      Rack::Utils.parse_nested_query("foo#{"[a]" * len}=bar")
+    }.should.raise(RangeError)
+
+    lambda {
+      Rack::Utils.parse_nested_query("foo#{"[a]" * (len - 1)}=bar")
+    }.should.not.raise
+  end
+
   should "parse nested query strings correctly" do
     Rack::Utils.parse_nested_query("foo").
       should.equal "foo" => nil