mssola / user_agent

This project has been moved, check the README.md file!

Home Page:https://github.com/mssola/useragent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firefox on Win XP incorrectly marked as Mobile

connor-prodege opened this issue · comments

Hi,

We love this library and are currently using this in production. we detected a bug today in the parsing of firefox's user agent on windows XP:

userAgentXPFF := "Mozilla/5.0 (Windows NT 5.2; rv:31.0) Gecko/20100101 Firefox/31.0"
parsed := user_agent.New(userAgentXPFF)
fmt.Println(parsed.Mobile())

will print true.

i've tracked down the issue to this line:

} else if len(comment) < 3 {
    p.mobile = true
    p.os = "FirefoxOS"

https://github.com/mssola/user_agent/blob/master/operating_systems.go#L116

Please let me know if this issue can be fixed.

Thanks! & great work!

Thanks for spotting this! :)

Thanks, works great!