Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old Ubuntu user agent parsing seems incorrect #7

Closed
janxious opened this issue Mar 29, 2015 · 3 comments
Closed

Old Ubuntu user agent parsing seems incorrect #7

janxious opened this issue Mar 29, 2015 · 3 comments

Comments

@janxious
Copy link

Obvious from looking at oss.yml why this is so, but I have what I believe to be a legitimate user agent string from an old version of Ubuntu that is failing the following test:

def test_ubuntu_10_device_detector
  agent_string = 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Ubuntu/10.10 Chromium/10.0.648.133 Chrome/10.0.648.133 Safari/534.16'

  uap = UserAgentParser::Parser.new.parse(agent_string)
  assert_equal 'Ubuntu 10.10', uap.os.to_s # UAP seemingly has rules to match this

  dd = DeviceDetector.new(agent_string)
  assert_equal 'Ubuntu', dd.os_name
end

Test output:

  1) Failure:
ImprovedUserAgentTest#test_ubuntu_10_device_detector [test/models/user_agent_test.rb:15]:
Expected: "Ubuntu"
  Actual: "$1"
@matisojka
Copy link
Contributor

Thanks for reporting the issue!

The oss.yml file itself is correct and detects the old Ubuntu, but what was wrong was the extraction / parsing of the name.

I am fixing and optimizing the code right now, going to release a new version ASAP.

@janxious
Copy link
Author

👍 I missed the other line that would pick it up in there.

@matisojka
Copy link
Contributor

This issue has been fixed. Thanks again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants