diff options
author | Ariejan de Vroom <ariejan@ariejan.net> | 2011-12-26 10:12:09 +0100 |
---|---|---|
committer | Ariejan de Vroom <ariejan@ariejan.net> | 2011-12-26 10:12:09 +0100 |
commit | 5ca836048d4f3319d24d2d4580912102eed54618 (patch) | |
tree | 4efe3f9390317a9dd0456d6883a2a6760de95aa6 /app | |
parent | be6e52c2f676927a373a2225f22f63120020f8cd (diff) | |
download | gitlab-ce-5ca836048d4f3319d24d2d4580912102eed54618.tar.gz |
Use URI::regexp for validating WebHook urls
Diffstat (limited to 'app')
-rw-r--r-- | app/models/web_hook.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 96684d15f8a..0058bd57b91 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -9,7 +9,7 @@ class WebHook < ActiveRecord::Base validates :url, presence: true, format: { - with: /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix, + with: URI::regexp(%w(http https)), message: "should be a valid url" } def execute(data) |