Skip to content

Commit 409f558

Browse files
committed
Add User-Agent header with version info in API client requests.
1 parent 176ee7b commit 409f558

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"xurl/auth"
1818
"xurl/config"
1919
xurlErrors "xurl/errors"
20+
"xurl/version"
2021
)
2122

2223
// ApiClient handles API requests
@@ -121,6 +122,8 @@ func (c *ApiClient) BuildRequest(method, endpoint string, headers []string, body
121122
req.Header.Add("Authorization", authHeader)
122123
}
123124
}
125+
126+
req.Header.Add("User-Agent", "xurl/"+version.Version)
124127

125128
return req, nil
126129
}

0 commit comments

Comments
 (0)