user_agent
user_agent copied to clipboard
PhantomJS user agent
Description
The user agent name for PhantomJS is being reported as Safari when it probably should be PhantomJS.
Steps to reproduce
Get name value of PhantomJS user agent: Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1
- Expected behavior: user agent
nameisPhantomJS - Actual behavior: user agent
nameisSafari
user_agent version
0.5.3
Go version and interpreter
1.16.6
Code example
package main
import (
"fmt"
"github.com/mssola/user_agent"
)
func main() {
ua := user_agent.New(
"Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1")
name, _ := ua.Browser()
fmt.Printf("%v\n", name) // This should be "PhantomJS" instead of "Safari"
}
Golang playground example: https://play.golang.org/p/2cXcLn1Kzi3