fix(BRIDGE-264): ignore apple notes as User-Agentt

This commit is contained in:
Atanas Janeshliev
2024-11-12 17:23:08 +01:00
parent af01c63298
commit acf2fc32c4
3 changed files with 39 additions and 2 deletions

View File

@ -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"))
}