From 3e955b450bd0008afb7b3c79c2248cc718fb3f81 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 6 Oct 2025 08:21:52 +0530 Subject: [PATCH] fix: naive url validation broke template syntax --- enterprise/app/models/concerns/safe_endpoint_validatable.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/enterprise/app/models/concerns/safe_endpoint_validatable.rb b/enterprise/app/models/concerns/safe_endpoint_validatable.rb index 53c2cfeb7..b151b10e7 100644 --- a/enterprise/app/models/concerns/safe_endpoint_validatable.rb +++ b/enterprise/app/models/concerns/safe_endpoint_validatable.rb @@ -23,7 +23,10 @@ module Concerns::SafeEndpointValidatable end def parse_endpoint_uri - URI.parse(endpoint_url) + # Strip Liquid template syntax for validation + # Replace {{ variable }} with a placeholder value + sanitized_url = endpoint_url.gsub(/\{\{[^}]+\}\}/, 'placeholder') + URI.parse(sanitized_url) rescue URI::InvalidURIError nil end