Skip to content

Commit

Permalink
Tweak safeguard so that empty strings are handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
petergoldstein committed Dec 27, 2022
1 parent ead2f5a commit b1434d2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/database_cleaner/safeguard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ def given?

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
Expand Down

0 comments on commit b1434d2

Please sign in to comment.