Fix pasting Personal Access Token to auth login for GHE
This commit is contained in:
parent
04dcb327ca
commit
f807795491
2 changed files with 4 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ func HasMinimumScopes(httpClient httpClient, hostname, authToken string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
req.Header.Set("Autorization", "token "+authToken)
|
||||
req.Header.Set("Authorization", "token "+authToken)
|
||||
|
||||
res, err := httpClient.Do(req)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ func Test_HasMinimumScopes(t *testing.T) {
|
|||
fakehttp := &httpmock.Registry{}
|
||||
defer fakehttp.Verify(t)
|
||||
|
||||
var gotAuthorization string
|
||||
fakehttp.Register(httpmock.REST("GET", ""), func(req *http.Request) (*http.Response, error) {
|
||||
gotAuthorization = req.Header.Get("authorization")
|
||||
return &http.Response{
|
||||
Request: req,
|
||||
StatusCode: 200,
|
||||
|
|
@ -70,6 +72,7 @@ func Test_HasMinimumScopes(t *testing.T) {
|
|||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, gotAuthorization, "token ATOKEN")
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue