fix(api): expose SkipDefaultHeaders option

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-10-13 16:37:04 +01:00
parent b9e04ef83d
commit b81c2495d2
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -17,22 +17,24 @@ type tokenGetter interface {
}
type HTTPClientOptions struct {
AppVersion string
CacheTTL time.Duration
Config tokenGetter
EnableCache bool
Log io.Writer
LogColorize bool
LogVerboseHTTP bool
AppVersion string
CacheTTL time.Duration
Config tokenGetter
EnableCache bool
Log io.Writer
LogColorize bool
LogVerboseHTTP bool
SkipDefaultHeaders bool
}
func NewHTTPClient(opts HTTPClientOptions) (*http.Client, error) {
// Provide invalid host, and token values so gh.HTTPClient will not automatically resolve them.
// The real host and token are inserted at request time.
clientOpts := ghAPI.ClientOptions{
Host: "none",
AuthToken: "none",
LogIgnoreEnv: true,
Host: "none",
AuthToken: "none",
LogIgnoreEnv: true,
SkipDefaultHeaders: opts.SkipDefaultHeaders,
}
debugEnabled, debugValue := utils.IsDebugEnabled()