Add possibility to use other ports than 80/443 in webhooks (#234)

* Added possibility to use other ports than 80/443

* simplify regex to allow colon anywhere
This commit is contained in:
anhofmann authored and Charlie Smurthwaite committed 2017-08-21 22:23:31 +01:00
1 parent 5634640fd8
commit 98daf6d30c
1 file changed
+1 -1
+1 -1
View File
@@ -28,7 +28,7 @@ class Webhook < ApplicationRecord
has_many :webhook_requests has_many :webhook_requests
validates :name, :presence => true validates :name, :presence => true
validates :url, :presence => true, :format => {:with => /\Ahttps?\:\/\/[a-z0-9\-\.\_\?\&\/\+]+\z/i, :allow_blank => true} validates :url, :presence => true, :format => {:with => /\Ahttps?\:\/\/[a-z0-9\-\.\_\?\&\/\+:]+\z/i, :allow_blank => true}
scope :enabled, -> { where(:enabled => true) } scope :enabled, -> { where(:enabled => true) }