mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 18:48:08 +00:00 
			
		
		
		
	Use cleanhttp instead of bare http.Client
This commit is contained in:
		| @@ -1,9 +1,8 @@ | ||||
| package github | ||||
|  | ||||
| import ( | ||||
| 	"net/http" | ||||
|  | ||||
| 	"github.com/google/go-github/github" | ||||
| 	"github.com/hashicorp/go-cleanhttp" | ||||
| 	"github.com/hashicorp/vault/logical" | ||||
| 	"github.com/hashicorp/vault/logical/framework" | ||||
| 	"golang.org/x/oauth2" | ||||
| @@ -54,7 +53,7 @@ type backend struct { | ||||
| // Client returns the GitHub client to communicate to GitHub via the | ||||
| // configured settings. | ||||
| func (b *backend) Client(token string) (*github.Client, error) { | ||||
| 	tc := &http.Client{} | ||||
| 	tc := cleanhttp.DefaultClient() | ||||
| 	if token != "" { | ||||
| 		tc = oauth2.NewClient(oauth2.NoContext, &tokenSource{Value: token}) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jeff Mitchell
					Jeff Mitchell