servername in user-agent to play nice

This commit is contained in:
Ted Unangst 2019-07-15 12:57:50 -04:00
parent e9da20ff42
commit 46a50e5b80
1 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ func PostMsg(keyname string, key *rsa.PrivateKey, url string, msg []byte) error
if err != nil { if err != nil {
return err return err
} }
req.Header.Set("User-Agent", "honksnonk/5.0") req.Header.Set("User-Agent", "honksnonk/5.0; " + serverName)
req.Header.Set("Content-Type", theonetruename) req.Header.Set("Content-Type", theonetruename)
zig(keyname, key, req, msg) zig(keyname, key, req, msg)
resp, err := client.Do(req) resp, err := client.Do(req)
@ -120,7 +120,7 @@ func GetJunkTimeout(url string, timeout time.Duration) (junk.Junk, error) {
} }
req.Header.Set("Accept", at) req.Header.Set("Accept", at)
req.Header.Set("Accept-Encoding", "gzip") req.Header.Set("Accept-Encoding", "gzip")
req.Header.Set("User-Agent", "honksnonk/5.0") req.Header.Set("User-Agent", "honksnonk/5.0; " + serverName)
if timeout > 0 { if timeout > 0 {
ctx, cancel := context.WithTimeout(context.Background(), timeout) ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel() defer cancel()