Skip to content

Commit dc7bf15

Browse files
committed
fix: auth scheme and token from client level #959
1 parent 67ff271 commit dc7bf15

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

request_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,21 @@ func TestRequestAuthScheme(t *testing.T) {
706706
assertEqual(t, tokenValue, resp.Request.Header.Get(hdrAuthorizationKey))
707707
})
708708

709+
t.Run("only client level auth token GH959", func(t *testing.T) {
710+
tokenValue := "004DDB79-6801-4587-B976-F093E6AC44FF"
711+
712+
c := dc().
713+
SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}).
714+
SetAuthToken(tokenValue)
715+
716+
resp, err := c.R().
717+
Get(ts.URL + "/profile")
718+
719+
assertError(t, err)
720+
assertEqual(t, http.StatusOK, resp.StatusCode())
721+
assertEqual(t, "Bearer "+tokenValue, resp.Request.Header.Get(hdrAuthorizationKey))
722+
})
723+
709724
}
710725

711726
func TestRequestDigestAuth(t *testing.T) {

0 commit comments

Comments
 (0)