diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-12-13 18:10:34 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-12-13 18:10:34 +0100 |
commit | 55ed8391d5ad741c461bc80b771b82d77b64707f (patch) | |
tree | b163365096b99ad56a2ad41983e6438b4c3aa5ef /pkg | |
parent | d0eeb901a0fd0c787289dc5beae6ed0e66905c42 (diff) |
[cc] standardize ua
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/vpn/bonafide/bonafide.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/vpn/bonafide/bonafide.go b/pkg/vpn/bonafide/bonafide.go index 7bce545..024a7e1 100644 --- a/pkg/vpn/bonafide/bonafide.go +++ b/pkg/vpn/bonafide/bonafide.go @@ -26,6 +26,7 @@ import ( "log" "net/http" "os" + "runtime" "strings" "time" @@ -36,6 +37,7 @@ import ( const ( secondsPerHour = 60 * 60 retryFetchJSONSeconds = 15 + winUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53" ) const ( @@ -175,6 +177,9 @@ func (b *Bonafide) GetPemCertificate() ([]byte, error) { if b.token != nil { req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", b.token)) } + if runtime.GOOS == "windows" { + req.Header.Add("User-Agent", winUserAgent) + } resp, err := b.client.Do(req) if err != nil { return nil, err |