diff options
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/key.rb | 2 | ||||
| -rw-r--r-- | app/models/project.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/key.rb b/app/models/key.rb index 0f2fc45abc9..11c01242b15 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -24,7 +24,7 @@ class Key < ActiveRecord::Base before_validation :strip_white_space validates :title, presence: true, length: { within: 0..255 } - validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\Assh-.*\Z/ }, uniqueness: true + validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\A(ssh|ecdsa)-.*\Z/ }, uniqueness: true validate :fingerprintable_key delegate :name, :email, to: :user, prefix: true diff --git a/app/models/project.rb b/app/models/project.rb index 4beba83df2c..8297c11ba8a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -88,7 +88,7 @@ class Project < ActiveRecord::Base validates_uniqueness_of :path, scope: :namespace_id validates :import_url, - format: { with: URI::regexp(%w(http https)), message: "should be a valid url" }, + format: { with: URI::regexp(%w(git http https)), message: "should be a valid url" }, if: :import? validate :check_limit |
