Firefox on Win XP incorrectly marked as Mobile
connor-prodege opened this issue · comments
connor-prodege commented
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!
Miquel Sabaté Solà commented
Thanks for spotting this! :)
connor-prodege commented
Thanks, works great!