@@ -691,7 +691,7 @@ func TestRequestAuthScheme(t *testing.T) {
691691 assertEqual (t , http .StatusOK , resp .StatusCode ())
692692 })
693693
694- t .Run ("empty auth scheme GH954" , func (t * testing.T ) {
694+ t .Run ("empty auth scheme at client level GH954" , func (t * testing.T ) {
695695 tokenValue := "004DDB79-6801-4587-B976-F093E6AC44FF"
696696
697697 // set client level
@@ -706,6 +706,38 @@ func TestRequestAuthScheme(t *testing.T) {
706706 assertEqual (t , tokenValue , resp .Request .Header .Get (hdrAuthorizationKey ))
707707 })
708708
709+ t .Run ("empty auth scheme at request level GH954" , func (t * testing.T ) {
710+ tokenValue := "004DDB79-6801-4587-B976-F093E6AC44FF"
711+
712+ // set client level
713+ c := dc ().
714+ SetTLSClientConfig (& tls.Config {InsecureSkipVerify : true }).
715+ SetAuthToken (tokenValue )
716+
717+ resp , err := c .R ().
718+ SetAuthScheme ("" ).
719+ Get (ts .URL + "/profile" )
720+
721+ assertError (t , err )
722+ assertEqual (t , http .StatusOK , resp .StatusCode ())
723+ assertEqual (t , tokenValue , resp .Request .Header .Get (hdrAuthorizationKey ))
724+ })
725+
726+ t .Run ("only client level auth token GH959" , func (t * testing.T ) {
727+ tokenValue := "004DDB79-6801-4587-B976-F093E6AC44FF"
728+
729+ c := dc ().
730+ SetTLSClientConfig (& tls.Config {InsecureSkipVerify : true }).
731+ SetAuthToken (tokenValue )
732+
733+ resp , err := c .R ().
734+ Get (ts .URL + "/profile" )
735+
736+ assertError (t , err )
737+ assertEqual (t , http .StatusOK , resp .StatusCode ())
738+ assertEqual (t , "Bearer " + tokenValue , resp .Request .Header .Get (hdrAuthorizationKey ))
739+ })
740+
709741}
710742
711743func TestRequestDigestAuth (t * testing.T ) {
0 commit comments