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

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

gaojunhuicavon opened this issue · comments

commented

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)