diff --git a/all_test.go b/all_test.go index fb0cf05..51c761b 100644 --- a/all_test.go +++ b/all_test.go @@ -25,10 +25,15 @@ var uastrings = []struct { expected: "Mozilla:5.0 Browser:Googlebot-2.1 Bot:true Mobile:false", }, { - title: "GoogleBotSmartphone", + title: "GoogleBotSmartphone (iPhone)", ua: "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", expected: "Mozilla:5.0 Browser:Googlebot-2.1 Bot:true Mobile:true", }, + { + title: "GoogleBotSmartphone (Android)", + ua: "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", + expected: "Mozilla:5.0 Browser:Googlebot-2.1 Bot:true Mobile:true", + }, { title: "BingBot", ua: "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)", diff --git a/operating_systems.go b/operating_systems.go index aebd8b3..329f8ab 100644 --- a/operating_systems.go +++ b/operating_systems.go @@ -88,6 +88,8 @@ func webkit(p *UserAgent, comment []string) { } if len(comment) > 3 { p.localization = comment[3] + } else if len(comment) == 3 { + _ = p.googleBot() } } else if len(comment) > 0 { if len(comment) > 3 {