Skip to content

Fix undefined method `downcase' error

Vasilii Iakliushin requested to merge fix_undefined_method_downcase into master

What does this MR do and why?

Contributes to https://new-sentry.gitlab.net/organizations/gitlab/issues/483109

Problem

Users can provide an object type that doesn't support downcase method (for example, a hash). That leads to 500 error.

Solution

Convert the ref_type value to string before calling downcase method.

Screenshots or screen recordings

Screenshot_2023-12-06_at_11.58.54

How to set up and validate locally

  1. Visit http://gdk.test:3000/gitlab-org/gitlab-test/-/blob/master/README.md?ref_type[a]=b (update the URI if necessary)
  2. You shouldn't see an error

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports