1
0
mirror of https://github.com/writeas/go-writeas.git synced 2025-07-27 21:18:19 +00:00

Set User-Agent header instead of Adding it

This commit is contained in:
Matt Baer 2019-05-26 14:39:04 -04:00
parent 801952e0b5
commit 8728275c31

View File

@ -191,7 +191,7 @@ func (c *Client) prepareRequest(r *http.Request) {
if ua == "" {
ua = "go-writeas v" + Version
}
r.Header.Add("User-Agent", ua)
r.Header.Set("User-Agent", ua)
r.Header.Add("Content-Type", "application/json")
if c.token != "" {
r.Header.Add("Authorization", "Token "+c.token)