Tweak safeguard so that empty strings are handled correctly

This commit is contained in:
Peter Goldstein 2022-12-26 20:51:48 -05:00
parent ead2f5aa5c
commit b1434d2b9d

View file

@ -53,12 +53,11 @@ module DatabaseCleaner
def remote?(url)
return false unless url
parsed = URI.parse(url)
return false if parsed.scheme == 'sqlite3:'
host = parsed.host
return false unless host
return false if host.nil? || host.empty?
return false if LOCAL.include?(host)
return false if host.end_with? '.local'
true