Skip to content

Fix NoMethodError for BranchesController

Vasilii Iakliushin requested to merge 460474_fix_no_method_error into master

What does this MR do and why?

Contributes to #460474 (closed)

Problem

BranchesController#index uses params directly without verifying their type.

Solution

Use StrongParameters to automatically exclude non string query parameters.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-05-06_at_18.18.31 Screenshot_2024-05-06_at_18.19.12

How to set up and validate locally

  1. Visit http://gdk.test:3000/gitlab-org/gitlab-test/-/branches/all?page[]=3
  2. You should not see a 500 error.
Edited by Vasilii Iakliushin

Merge request reports