Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Handle `URI.parse` returning empty string in host instead of nil

Christophe Bliardd2658792c38e
diff --git a/app/validators/secure_context_uri_validator.rb b/app/validators/secure_context_uri_validator.rb
index 377e6e710d8..66790468d8a 100644
--- a/app/validators/secure_context_uri_validator.rb
+++ b/app/validators/secure_context_uri_validator.rb
@@ -40,7 +40,7 @@ class SecureContextUriValidator < ActiveModel::EachValidator
end
# The URI could be parsable but not contain a host name
- if uri.host.nil?
+ if uri.host.blank?
contract.errors.add(attribute, :invalid_url)
return
end