diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 96684d15..0058bd57 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)