From 794cbf3e38a505ed8653ee3c137f65b3fc395f88 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 26 Feb 2013 14:30:19 +0100 Subject: allow non-String default params in the router. Closes #9435. Skip valid encoding checks for non-String parameters that come from the matched route's defaults. --- actionpack/lib/action_dispatch/routing/route_set.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index ff86f87d49..ca31b5e02e 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -31,6 +31,8 @@ module ActionDispatch # If any of the path parameters has a invalid encoding then # raise since it's likely to trigger errors further on. params.each do |key, value| + next unless value.respond_to?(:valid_encoding?) + unless value.valid_encoding? raise ActionController::BadRequest, "Invalid parameter: #{key} => #{value}" end -- cgit v1.2.3