Skip to content

Commit 49d2559

Browse files
authored
Add dev to user-agent for stacklok users (#168)
1 parent 6afa386 commit 49d2559

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/updates/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"io"
77
"net/http"
8+
"os"
89
)
910

1011
// VersionClient is an interface for calling the update service API.
@@ -40,6 +41,10 @@ func (d *defaultVersionClient) GetLatestVersion(instanceID string, currentVersio
4041

4142
// Set headers
4243
userAgent := fmt.Sprintf("toolhive/%s", currentVersion)
44+
// Add `dev` to the user agent for Stacklok devs.
45+
if os.Getenv("TOOLHIVE_DEV") != "" {
46+
userAgent += " dev"
47+
}
4348
req.Header.Set(instanceIDHeader, instanceID)
4449
req.Header.Set(userAgentHeader, userAgent)
4550

0 commit comments

Comments
 (0)