Skip to content

Commit

Permalink
Adding more info to user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
soareswallace committed Jan 23, 2025
1 parent aef00a6 commit a9828c1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions incognia.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"runtime"
"time"
)

Expand Down Expand Up @@ -384,7 +385,18 @@ func (c *Client) registerLogin(login *Login) (*TransactionAssessment, error) {
}

func (c *Client) doRequest(request *http.Request, response interface{}) error {
libVersion := "1.16.1" // Replace this with actual lib version

userAgent := fmt.Sprintf(
"incognia-api-go/%s (%s %s) Go/%s",
libVersion,
runtime.GOOS,
runtime.GOARCH,
runtime.Version(),
)

request.Header.Add("Content-Type", "application/json")
request.Header.Add("user-agent", userAgent)

err := c.authorizeRequest(request)
if err != nil {
Expand Down

0 comments on commit a9828c1

Please sign in to comment.