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

Improved Windows detection #371

Merged

Conversation

roccozanni
Copy link

In some cases, the os parser was incorrectly producing a os string containing also the Windows version. For example, with iTunes user agent strings like this one:

iTunes/12.7.1 (Windows; Microsoft Windows 7 Ultimate Edition Service Pack 1 (Build 7601)) AppleWebKit/7604.3005.2001.1

we were ending up with a bunch of values like Windows 7 or Windows XP instead of just Windows like it's expected

This PR address this issue by:

  • removing the regex that was causing this incorrect behaviour
  • improving another regexp that was already addressing this issue, although partially
  • adding more tests based on real user agents collected by our platform and fixing a couple of existing ones

…dding the version number into the family string
@commenthol commenthol merged commit 45833a4 into ua-parser:master Jan 12, 2019
This was referenced Jan 12, 2019
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

Successfully merging this pull request may close these issues.

2 participants