mirror of
https://github.com/mpolden/echoip.git
synced 2025-06-26 04:37:51 +02:00
return parsed and raw user agent
This commit is contained in:
@ -5,9 +5,10 @@ import (
|
||||
)
|
||||
|
||||
type UserAgent struct {
|
||||
Product string
|
||||
Version string
|
||||
Comment string
|
||||
Product string `json:"product,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
RawValue string `json:"raw_value,omitempty"`
|
||||
}
|
||||
|
||||
func Parse(s string) UserAgent {
|
||||
@ -31,8 +32,9 @@ func Parse(s string) UserAgent {
|
||||
}
|
||||
}
|
||||
return UserAgent{
|
||||
Product: parts[0],
|
||||
Version: version,
|
||||
Comment: comment,
|
||||
Product: parts[0],
|
||||
Version: version,
|
||||
Comment: comment,
|
||||
RawValue: s,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user