diff options
author | evuez <helloevuez@gmail.com> | 2016-02-22 15:55:36 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-26 22:34:06 +0300 |
commit | 4d0e2979b9a17160ad93ff704e7a51f78b4f3b4c (patch) | |
tree | 1043f0701028e1abc9155821ae442da16a99a763 /app/validators/url_validator.rb | |
parent | 01160fc06182de89c400af174861f6545ad6ceb8 (diff) |
Allow webhooks URL to have leading and trailing spaces
Diffstat (limited to 'app/validators/url_validator.rb')
-rw-r--r-- | app/validators/url_validator.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/validators/url_validator.rb b/app/validators/url_validator.rb index 2848b9cd33d..a77beb2683d 100644 --- a/app/validators/url_validator.rb +++ b/app/validators/url_validator.rb @@ -29,8 +29,11 @@ class UrlValidator < ActiveModel::EachValidator end def valid_url?(value) + return false if value.nil? + options = default_options.merge(self.options) + value.strip! value =~ /\A#{URI.regexp(options[:protocols])}\z/ end end |