Class: Gitlab::SafeDeviceDetector

Inherits:
DeviceDetector
  • Object
show all
Defined in:
lib/gitlab/safe_device_detector.rb

Constant Summary collapse

USER_AGENT_MAX_SIZE =
1024

Instance Method Summary collapse

Constructor Details

#initialize(user_agent) ⇒ SafeDeviceDetector

Returns a new instance of SafeDeviceDetector.



9
10
11
12
# File 'lib/gitlab/safe_device_detector.rb', line 9

def initialize(user_agent)
  super(user_agent)
  @user_agent = user_agent && user_agent[0..USER_AGENT_MAX_SIZE]
end