diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-07-22 18:38:08 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-07-22 18:38:08 +0300 |
commit | 77e2e453649220ba9c002c935bbc18c34fbf5b11 (patch) | |
tree | 7e08870937bc55583fbf5d82e4448f58605749e8 /app | |
parent | e48851de62086b65c75a3dd802743e722d5d7be8 (diff) |
Validate certificate chain only if it's changed
This validation prevents the domain from being saved from the UI
e.g. when user tries to enable Let's Encrypt integration
Diffstat (limited to 'app')
-rw-r--r-- | app/models/pages_domain.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index e6e491634ab..27c122d3559 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -22,7 +22,7 @@ class PagesDomain < ApplicationRecord validate :validate_pages_domain validate :validate_matching_key, if: ->(domain) { domain.certificate.present? || domain.key.present? } - validate :validate_intermediates, if: ->(domain) { domain.certificate.present? } + validate :validate_intermediates, if: ->(domain) { domain.certificate.present? && domain.certificate_changed? } attr_encrypted :key, mode: :per_attribute_iv_and_salt, |