Skip to content

Always sends HTTP user-agent of git/1.0? #883

@TobiX

Description

@TobiX

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededno-autocloseIssues/PRs to be ignored by stale bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy