diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-02-26 12:59:11 -0800 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-02-26 12:59:11 -0800 |
commit | 6a235faa2a0496b88616aaf30ee1d0a60adaa0bb (patch) | |
tree | 760495b424aca39d91fb06a8b04be84d79347555 /actionpack/lib | |
parent | 923ec86f04ea9c55e646cba1d0d588d033252d17 (diff) | |
parent | 794cbf3e38a505ed8653ee3c137f65b3fc395f88 (diff) | |
download | rails-6a235faa2a0496b88616aaf30ee1d0a60adaa0bb.tar.gz rails-6a235faa2a0496b88616aaf30ee1d0a60adaa0bb.tar.bz2 rails-6a235faa2a0496b88616aaf30ee1d0a60adaa0bb.zip |
Merge pull request #9439 from senny/9435_router_params_as_integers
convert non-string default params to strings in the router.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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 |