Skip to content

Commit

Permalink
Merge pull request #15 from DataDome/refacto/update-api-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauredg authored Dec 13, 2023
2 parents 4b9b5f1 + 819f615 commit 7674f2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datadome-client-go/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ func NewClient(host, password *string) (*Client, error) {
}

func (c *Client) doRequest(req *http.Request, httpResponse *HttpResponse) (*HttpResponse, error) {
// Add apikey as a query parameter on each request for authentication
// Add apikey as a header on each request for authentication
// Add also withoutTraffic parameter to true to have better performances
q := req.URL.Query()
q.Add("apikey", c.Token)
req.Header.Set("x-api-key", c.Token)
q.Add("withoutTraffic", "true")
req.URL.RawQuery = q.Encode()

Expand Down

0 comments on commit 7674f2b

Please sign in to comment.