diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-09-29 12:46:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-29 12:46:30 -0700 |
commit | b84736e9b6401df0c6eeab9950bef09458a6aefd (patch) | |
tree | d9175208de3236db75a33879750a57b3000ba096 /vendor/github.com/mssola/user_agent/user_agent.go | |
parent | 8b9dbb86133ff0fd6002a391268383d1593918ca (diff) | |
download | chat-b84736e9b6401df0c6eeab9950bef09458a6aefd.tar.gz chat-b84736e9b6401df0c6eeab9950bef09458a6aefd.tar.bz2 chat-b84736e9b6401df0c6eeab9950bef09458a6aefd.zip |
Updating server dependancies. (#7538)
Diffstat (limited to 'vendor/github.com/mssola/user_agent/user_agent.go')
-rw-r--r-- | vendor/github.com/mssola/user_agent/user_agent.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/vendor/github.com/mssola/user_agent/user_agent.go b/vendor/github.com/mssola/user_agent/user_agent.go index 74ddf273c..36e8d1bfa 100644 --- a/vendor/github.com/mssola/user_agent/user_agent.go +++ b/vendor/github.com/mssola/user_agent/user_agent.go @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2014 Miquel Sabaté Solà <mikisabate@gmail.com> +// Copyright (C) 2012-2017 Miquel Sabaté Solà <mikisabate@gmail.com> // This file is licensed under the MIT license. // See the LICENSE file. @@ -8,9 +8,7 @@ // information that has been extracted from a parsed User Agent string. package user_agent -import ( - "strings" -) +import "strings" // A section contains the name of the product, its version and // an optional comment. @@ -141,7 +139,9 @@ func (p *UserAgent) Parse(ua string) { } if len(sections) > 0 { - p.mozilla = sections[0].version + if sections[0].name == "Mozilla" { + p.mozilla = sections[0].version + } p.detectBrowser(sections) p.detectOS(sections[0]) @@ -167,3 +167,8 @@ func (p *UserAgent) Bot() bool { func (p *UserAgent) Mobile() bool { return p.mobile } + +// Returns the original given user agent. +func (p *UserAgent) UA() string { + return p.ua +} |