user_agent icon indicating copy to clipboard operation
user_agent copied to clipboard

A mobile user agent is reported as a non-mobile user agent.

Open gaojunhuicavon opened this issue 3 years ago • 0 comments

Description

The following ua containing the keyword iPhone wants to be reported as a mobile ua:

Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Jike/7.6.7 /sa-sdk-ios/sensors-verify/track.midway.run?jike

Steps to reproduce

import "github.com/mssola/user_agent"

func main() {
	ua := "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Jike/7.6.7 /sa-sdk-ios/sensors-verify/track.midway.run?jike"
	user_agent.New(ua).Mobile() // True is expected, but false is got.
}

user_agent version

v0.5.2

Go version and interpreter

go version go1.14.2 darwin/amd64

Operating system

macOS Mojave 10.14.6(18G6032)

gaojunhuicavon avatar Dec 24 '20 09:12 gaojunhuicavon