Skip to content

Commit

Permalink
Added support for user agent client hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Aug 11, 2024
1 parent cae3c41 commit 7fe2500
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ahoy_matey.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = ">= 3"

spec.add_dependency "activesupport", ">= 6.1"
spec.add_dependency "device_detector", ">= 1"
spec.add_dependency "device_detector", ">= 1.1"
spec.add_dependency "safely_block", ">= 0.4"
end
2 changes: 1 addition & 1 deletion lib/ahoy/base_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def bot?
@bot = begin
if request
if Ahoy.user_agent_parser == :device_detector
detector = DeviceDetector.new(request.user_agent)
detector = DeviceDetector.new(request.user_agent, request.headers)
if Ahoy.bot_detection_version == 2
detector.bot? || (detector.device_type.nil? && detector.os_name.nil?)
else
Expand Down
2 changes: 1 addition & 1 deletion lib/ahoy/visit_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def traffic_properties

def tech_properties
if Ahoy.user_agent_parser == :device_detector
client = DeviceDetector.new(request.user_agent)
client = DeviceDetector.new(request.user_agent, request.headers)
device_type =
case client.device_type
when "smartphone"
Expand Down

0 comments on commit 7fe2500

Please sign in to comment.