Skip to content

Commit

Permalink
fix: auth scheme and token from client level #959
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Jan 22, 2025
1 parent 67ff271 commit dc7bf15
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,21 @@ func TestRequestAuthScheme(t *testing.T) {
assertEqual(t, tokenValue, resp.Request.Header.Get(hdrAuthorizationKey))
})

t.Run("only client level auth token GH959", func(t *testing.T) {
tokenValue := "004DDB79-6801-4587-B976-F093E6AC44FF"

c := dc().
SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}).
SetAuthToken(tokenValue)

resp, err := c.R().
Get(ts.URL + "/profile")

assertError(t, err)
assertEqual(t, http.StatusOK, resp.StatusCode())
assertEqual(t, "Bearer "+tokenValue, resp.Request.Header.Get(hdrAuthorizationKey))
})

}

func TestRequestDigestAuth(t *testing.T) {
Expand Down

0 comments on commit dc7bf15

Please sign in to comment.