-
Notifications
You must be signed in to change notification settings - Fork 811
Closed
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededno-autocloseIssues/PRs to be ignored by stale botIssues/PRs to be ignored by stale bot
Description
It seems this library always uses the user agent git/1.0
in HTTP requests, since that is hardcoded here:
go-git/plumbing/transport/http/common.go
Line 27 in 72ce996
req.Header.Add("User-Agent", "git/1.0") |
I see some code to support "in-band"(?) user-agents:
go-git/plumbing/protocol/packp/capability/capability.go
Lines 246 to 254 in 72ce996
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?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededno-autocloseIssues/PRs to be ignored by stale botIssues/PRs to be ignored by stale bot