leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
536 stars 215 forks source link

[Rails5] Fixes for ActionDispatch::Routing::INSECURE_URL_PARAMETERS_MESSAGE #323

Closed harryPL closed 7 years ago

harryPL commented 7 years ago

While migrating my app to Rails 5 I encountered on ActionDispatch::Routing exception. This PR removes the deprecation warnings associated with the merge! method. It also removes the ActionDispatch::Routing exception. The exact message of the exception is "

Attempting to generate a URL from non-sanitized request parameters! An attacker can inject malicious data into the generated URL, such as changing the host. Whitelist and sanitize passed parameters to be secure."

The problem is present due to changes to ActionController::Parameters in Rails 5.

Excerpt from the framework calls

actionpack (5.0.0) lib/action_dispatch/routing/url_for.rb:176:in url_for' /home/pfurman/.rvm/gems/ruby-2.3.1@rails5/bundler/gems/wice_grid-f3d6c462af2b/lib/wice/grid_renderer.rb:550:inbase_link_for_filter' /home/pfurman/.rvm/gems/ruby-2.3.1@rails5/bundler/gems/wice_grid-f3d6c462af2b/lib/wice/helpers/wice_grid_view_helpers.rb:471:in grid_html' /home/pfurman/.rvm/gems/ruby-2.3.1@rails5/bundler/gems/wice_grid-f3d6c462af2b/lib/wice/helpers/wice_grid_view_helpers.rb:124:indefine_grid' actionview (5.0.0) lib/action_view/template.rb:158:in `block in render'

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 37.512% when pulling 4c35b142e729fa0689cb6ec749a5f4844ba49f59 on harryPL:rails3 into f3d6c462af2b1b8ddee849db1083d846ab8d3a58 on leikind:rails3.

leikind commented 7 years ago

👍 thank you