diff options
author | evuez <helloevuez@gmail.com> | 2016-02-22 13:55:36 +0100 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-26 14:34:06 -0500 |
commit | 4d0e2979b9a17160ad93ff704e7a51f78b4f3b4c (patch) | |
tree | 1043f0701028e1abc9155821ae442da16a99a763 /app/validators | |
parent | 01160fc06182de89c400af174861f6545ad6ceb8 (diff) | |
download | gitlab-ce-4d0e2979b9a17160ad93ff704e7a51f78b4f3b4c.tar.gz |
Allow webhooks URL to have leading and trailing spacesevuez/gitlab-ce-webhook-url-spaces
Diffstat (limited to 'app/validators')
-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 |