fix(api): expose SkipDefaultHeaders option
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
b9e04ef83d
commit
b81c2495d2
1 changed files with 12 additions and 10 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue