From 98daf6d30ce4971315dc3feb1a083128d65d8b86 Mon Sep 17 00:00:00 2001 From: anhofmann Date: Mon, 21 Aug 2017 23:23:31 +0200 Subject: [PATCH] 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 --- app/models/webhook.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/webhook.rb b/app/models/webhook.rb index 88078df..d2dc24e 100644 --- a/app/models/webhook.rb +++ b/app/models/webhook.rb @@ -28,7 +28,7 @@ class Webhook < ApplicationRecord has_many :webhook_requests 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) }