From 64059e2351b42a85ffbcfc7c0067aa43d924448b Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Thu, 15 Jan 2026 22:13:41 -0500 Subject: [PATCH 1/2] Add test for webhook URL with trailing whitespace Currently fails because URI.parse rejects URLs with trailing spaces. --- test/models/webhook_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/models/webhook_test.rb b/test/models/webhook_test.rb index 52c43383d9..121c1a651b 100644 --- a/test/models/webhook_test.rb +++ b/test/models/webhook_test.rb @@ -35,6 +35,10 @@ class WebhookTest < ActiveSupport::TestCase webhook = Webhook.new name: "HTTPS", board: boards(:writebook), url: "https://example.com/webhook" assert webhook.valid? + + webhook = Webhook.new name: "TRAILING SPACE", board: boards(:writebook), url: "https://example.com/webhook " + assert webhook.valid? + assert_equal "https://example.com/webhook", webhook.url end test "deactivate" do From d8b6ea8bbadb0467793f052c6b96d77492f6b637 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Thu, 15 Jan 2026 22:13:47 -0500 Subject: [PATCH 2/2] Strip whitespace from webhook URLs Prevents validation errors when users accidentally include trailing spaces in webhook URLs. --- app/models/webhook.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/webhook.rb b/app/models/webhook.rb index 3b34af0410..f008aa9348 100644 --- a/app/models/webhook.rb +++ b/app/models/webhook.rb @@ -36,6 +36,7 @@ class Webhook < ApplicationRecord after_create :create_delinquency_tracker! normalizes :subscribed_actions, with: ->(value) { Array.wrap(value).map(&:to_s).uniq & PERMITTED_ACTIONS } + normalizes :url, with: -> { it.strip } validates :name, presence: true validate :validate_url