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

Incorrect Device Parsing for Nexus 5X in User-Agent Strings #132

Open
IvanKorshunovE opened this issue Jan 14, 2025 · 0 comments
Open

Incorrect Device Parsing for Nexus 5X in User-Agent Strings #132

IvanKorshunovE opened this issue Jan 14, 2025 · 0 comments

Comments

@IvanKorshunovE
Copy link

IvanKorshunovE commented Jan 14, 2025

The DeviceParser incorrectly parses certain user-agent strings, resulting in wrong values for the family, brand, and model fields.

Example of the Issue:
User-Agent String:
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko) Chrome/51.0.2702.81 Mobile Safari/537.36

Current Output:

{
  "family": "Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko",
  "brand": "Generic_Android",
  "model": "Nexus 5x build/mtc19t applewebkit/537.36 (KHTML, like Gecko"
}

Expected Output (not sure that it should be exactly like this):

{
  "family": "Nexus",
  "brand": "Generic_Android",
  "model": "Nexus 5x"
}

Steps to Reproduce:

  1. Provide the above user-agent string to the DeviceParser.

Perhaps this instance of DeviceParser is responsible for this:

DeviceParser(
    'Android \\d+?(?:\\.\\d+|)(?:\\.\\d+|); ([^;]+?)(?: Build|\\))',
    None,
    None,
    'Generic_Android',
    '$1',
)
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

1 participant