Skip to content

Commit

Permalink
fix: avoid sending dev as ev in user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
gris committed Oct 9, 2023
1 parent 02390e9 commit 0e5d58b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/turso/turso.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ func (t *Client) newRequest(method, urlPath string, body io.Reader) (*http.Reque
req.Header.Add("Authorization", fmt.Sprint("Bearer ", t.token))
}
req.Header.Add("TursoCliVersion", t.cliVersion)
req.Header.Add("User-Agent", fmt.Sprintf("turso-cli/%s (%s/%s)", t.cliVersion[1:], runtime.GOOS, runtime.GOARCH))
parsedCliVersion := t.cliVersion
if parsedCliVersion != "dev" {
parsedCliVersion = t.cliVersion[1:]
}
req.Header.Add("User-Agent", fmt.Sprintf("turso-cli/%s (%s/%s)", parsedCliVersion, runtime.GOOS, runtime.GOARCH))
req.Header.Add("Content-Type", "application/json")
return req, nil
}
Expand Down

0 comments on commit 0e5d58b

Please sign in to comment.