diff options
Diffstat (limited to 'app/validators')
-rw-r--r-- | app/validators/url_validator.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/validators/url_validator.rb b/app/validators/url_validator.rb index 75d1edb87..a90fb6958 100644 --- a/app/validators/url_validator.rb +++ b/app/validators/url_validator.rb @@ -10,5 +10,7 @@ class URLValidator < ActiveModel::EachValidator def compliant?(url) parsed_url = Addressable::URI.parse(url) parsed_url && %w(http https).include?(parsed_url.scheme) && parsed_url.host + rescue Addressable::URI::InvalidURIError + false end end |