mirror of
https://github.com/Rayzggz/server_torii.git
synced 2025-06-17 04:31:22 +08:00
22 lines
528 B
Go
22 lines
528 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/mssola/useragent"
|
|
)
|
|
|
|
func GetClearanceUserAgent(inputUA string) string {
|
|
if len(inputUA) < 8 || inputUA[:8] != "Mozilla/" {
|
|
return inputUA
|
|
}
|
|
|
|
ua := useragent.New(inputUA)
|
|
|
|
engin, enginVersion := ua.Engine()
|
|
browser, browserVersion := ua.Browser()
|
|
|
|
ret := fmt.Sprintf("Mozilla:%v,Module:%v,Platform:%v,OS:%v,Engine:%v,EngineVersion:%v,Browser:%v,BrowserVersion:%v", ua.Mozilla(), ua.Model(), ua.Platform(), ua.OS(), engin, enginVersion, browser, browserVersion)
|
|
return ret
|
|
|
|
}
|