mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user