diff options
Diffstat (limited to 'app/models/pages_domain.rb')
-rw-r--r-- | app/models/pages_domain.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index c21027455b1..2804588be85 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -245,8 +245,8 @@ class PagesDomain < ApplicationRecord def validate_pages_domain return unless domain - if domain.downcase.ends_with?(Settings.pages.host.downcase) - self.errors.add(:domain, "*.#{Settings.pages.host} is restricted. Please compare our documentation at https://docs.gitlab.com/ee/administration/pages/#advanced-configuration against your configuration.") + if domain.downcase.ends_with?(".#{Settings.pages.host.downcase}") || domain.casecmp(Settings.pages.host) == 0 + self.errors.add(:domain, "#{Settings.pages.host} and its subdomains cannot be used as custom pages domains. Please compare our documentation at https://docs.gitlab.com/ee/administration/pages/#advanced-configuration against your configuration.") end end |