Is this a bug in GitLab or in Ruby? It's hard to tell from the report and the patch...
Possibly a backport of https://github.com/ruby/ruby/pull/16801
Or Rails...
Possibly a backport of https://github.com/ruby/ruby/pull/16801