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

See https://hackerone.com/reports/156615
and https://github.com/ruby/ruby/commit/dd5118f8524c425894d4716
to know more.
pull/11863/head
Christophe Bliard 2 years ago
parent 4d03f2620b
commit d2658792c3
No known key found for this signature in database
GPG Key ID: 2BC07603210C3FA4
  1. 2
      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

Loading…
Cancel
Save