From 888f29383e1aaa7c04d7ac638c3852f6918bf0bf Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sun, 1 Mar 2020 11:27:26 -0600 Subject: [PATCH] add User-Agent header --- client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.go b/client.go index f17da50..8fe615b 100644 --- a/client.go +++ b/client.go @@ -10,6 +10,8 @@ import ( "net/http" ) +const UserAgent = "go-lifx" + type ( Client struct { accessToken string @@ -57,6 +59,7 @@ func (c *Client) NewRequest(method, url string, body io.Reader) (req *http.Reque } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.accessToken)) req.Header.Add("Content-Type", "application/json") + req.Header.Add("User-Agent", UserAgent) return }