Commit db49dba1 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Fix finding namespace with mixed case saved path

parent 29fe14e2
......@@ -130,7 +130,7 @@ class Namespace < ApplicationRecord
return unless host.ends_with?(gitlab_host)
name = host.delete_suffix(gitlab_host)
Namespace.where(parent_id: nil).find_by_path(name)
Namespace.where(parent_id: nil).by_path(name)
end
# overridden in ee
......
......@@ -194,7 +194,7 @@ describe Namespace do
describe '.find_by_pages_host' do
it 'finds namespace by GitLab Pages host and is case-insensitive' do
namespace = create(:namespace, name: 'topnamespace')
namespace = create(:namespace, name: 'topNAMEspace', path: 'topNAMEspace')
create(:namespace, name: 'annother_namespace')
host = "TopNamespace.#{Settings.pages.host.upcase}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment