mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-21 09:36:51 +00:00
fix(BRIDGE-264): ignore apple notes as User-Agentt
This commit is contained in:
@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@ -42,9 +43,12 @@ func New() *UserAgent {
|
||||
}
|
||||
|
||||
func (ua *UserAgent) SetClient(name, version string) {
|
||||
if strings.EqualFold("Mac OS X Notes", name) {
|
||||
return
|
||||
}
|
||||
|
||||
ua.lock.Lock()
|
||||
defer ua.lock.Unlock()
|
||||
|
||||
ua.client = fmt.Sprintf("%v/%v", name, regexp.MustCompile(`(.*) \((.*)\)`).ReplaceAllString(version, "$1-$2"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user