diff options
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 5663ebf8ba1..d5a7c172fec 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -123,8 +123,10 @@ class Namespace < ApplicationRecord def find_by_pages_host(host) gitlab_host = "." + Settings.pages.host.downcase - name = host.downcase.delete_suffix(gitlab_host) + host = host.downcase + return unless host.ends_with?(gitlab_host) + name = host.delete_suffix(gitlab_host) Namespace.find_by_full_path(name) end end |