rguerreiro / device

Device type detection library based on the useragent string. Refactored from my express-device repo.
MIT License
79 stars 27 forks source link

Desktop user agent without spaces reported as phone #28

Closed cclerke closed 4 years ago

cclerke commented 6 years ago

One of our users has this user agent being sent from a desktop device (trying to get more specific information from them): Mozilla/5.0(WindowsNT6.1;rv:31.0)Gecko/20100101Firefox/31.0. Because there are no spaces it is being reported as unknown and set to the default value of phone.

The fix seems as easy as replacing ua.match(/Windows (NT|XP|ME|9)/) with ua.match(/Windows( )?(NT|XP|ME|9)/).

rguerreiro commented 6 years ago

I'll try to check it and will submit a fix