add support for other Nexus devices as "mobile"

This commit is contained in:
Jeff Atwood 2016-03-15 16:46:41 -07:00
parent 3130dade49
commit d052f1746c
3 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ if defined?(Rack::MiniProfiler)
Rack::MiniProfiler.config.pre_authorize_cb = lambda do |env|
path = env['PATH_INFO']
(env['HTTP_USER_AGENT'] !~ /iPad|iPhone|Nexus 7|Android/) &&
(env['HTTP_USER_AGENT'] !~ /iPad|iPhone|Android/) &&
!skip.any?{|re| re =~ path}
end

View File

@ -1,6 +1,6 @@
module MobileDetection
def self.mobile_device?(user_agent)
user_agent =~ /Mobile|webOS|Nexus 7/ && !(user_agent =~ /iPad/)
user_agent =~ /Mobile|webOS|Nexus (5|6|7)/ && !(user_agent =~ /iPad/)
end
# we need this as a reusable chunk that is called from the cache

View File

@ -37,7 +37,7 @@ class LogAnalyzer
end
def is_mobile?
user_agent =~ /Mobile|webOS|Nexus 7/ && !(user_agent =~ /iPad/)
user_agent =~ /Mobile|webOS|Nexus (5|6|7)/ && !(user_agent =~ /iPad/)
end
def parsed_time