It seems this library always uses the user agent git/1.0 in HTTP requests, since that is hardcoded here:
|
req.Header.Add("User-Agent", "git/1.0") |
I see some code to support "in-band"(?) user-agents:
|
const userAgent = "go-git/5.x" |
|
|
|
// DefaultAgent provides the user agent string. |
|
func DefaultAgent() string { |
|
if envUserAgent, ok := os.LookupEnv("GO_GIT_USER_AGENT_EXTRA"); ok { |
|
return fmt.Sprintf("%s %s", userAgent, envUserAgent) |
|
} |
|
return userAgent |
|
} |
But this never seems to influence the HTTP User-Agent header. Am I correct in my assumption? Would it be possible to expose this value in the HTTP header?
It seems this library always uses the user agent
git/1.0in HTTP requests, since that is hardcoded here:go-git/plumbing/transport/http/common.go
Line 27 in 72ce996
I see some code to support "in-band"(?) user-agents:
go-git/plumbing/protocol/packp/capability/capability.go
Lines 246 to 254 in 72ce996
But this never seems to influence the HTTP User-Agent header. Am I correct in my assumption? Would it be possible to expose this value in the HTTP header?