summaryrefslogtreecommitdiff
path: root/app/models/hooks
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-12-01 18:45:36 -0500
committerRobert Speicher <rspeicher@gmail.com>2015-12-07 16:57:26 -0500
commitd5ea93469b4ec95916361c61876c949f60539211 (patch)
treea2a91371b4709725734016910ffb782b2dfd45a2 /app/models/hooks
parent2928e19d4356683119cf0d2bb269752253ea5d50 (diff)
downloadgitlab-ce-d5ea93469b4ec95916361c61876c949f60539211.tar.gz
Add custom UrlValidator
Diffstat (limited to 'app/models/hooks')
-rw-r--r--app/models/hooks/web_hook.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb
index 2caf26cc8c9..715ec5908b7 100644
--- a/app/models/hooks/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -31,8 +31,7 @@ class WebHook < ActiveRecord::Base
# HTTParty timeout
default_timeout Gitlab.config.gitlab.webhook_timeout
- validates :url, presence: true,
- format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }
+ validates :url, presence: true, url: true
def execute(data, hook_name)
parsed_url = URI.parse(url)