Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/split/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ def old_versions(experiment)
end

def is_robot?
request.user_agent =~ Split.configuration.robot_regex
defined?(request) && request.user_agent =~ Split.configuration.robot_regex
end

def is_ignored_ip_address?
return false if Split.configuration.ignore_ip_addresses.empty?

Split.configuration.ignore_ip_addresses.each do |ip|
return true if request.ip == ip || (ip.class == Regexp && request.ip =~ ip)
return true if defined?(request) && (request.ip == ip || (ip.class == Regexp && request.ip =~ ip))
end
false
end
Expand Down