[openstreetmap/openstreetmap-website] Add parameter validation to pagination (PR #4680)

Tom Hughes notifications at github.com
Thu Apr 11 09:00:45 UTC 2024


This adds validation to page/before/after/max_id parameters to various paginated requests so that we get a clean error instead of exception from the database when some nonsense value is fed into a query.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4680

-- Commit Summary --

  * Add framework for parameter validation using rails_param gem
  * Add validation for page number passed to notes#index
  * Add validation for before/after parameters to pagination concern
  * Add validation for maximum ID passed to changesets#index

-- File Changes --

    M Gemfile (1)
    M Gemfile.lock (4)
    M app/controllers/application_controller.rb (13)
    M app/controllers/changesets_controller.rb (2)
    M app/controllers/concerns/pagination_methods.rb (3)
    M app/controllers/errors_controller.rb (7)
    M app/controllers/notes_controller.rb (2)
    A app/views/errors/bad_request.html.erb (3)
    M config/locales/en.yml (3)
    M config/routes.rb (1)
    M test/controllers/changesets_controller_test.rb (9)
    M test/controllers/diary_entries_controller_test.rb (23)
    M test/controllers/errors_controller_test.rb (9)
    M test/controllers/notes_controller_test.rb (9)
    M test/controllers/traces_controller_test.rb (11)
    M test/controllers/user_blocks_controller_test.rb (40)
    M test/controllers/users_controller_test.rb (12)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4680.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4680.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4680
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4680 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240411/b7cf7fd7/attachment.htm>


More information about the rails-dev mailing list