@@ -691,7 +691,7 @@ func TestRequestAuthScheme(t *testing.T) {
691
691
assertEqual (t , http .StatusOK , resp .StatusCode ())
692
692
})
693
693
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 ) {
695
695
tokenValue := "004DDB79-6801-4587-B976-F093E6AC44FF"
696
696
697
697
// set client level
@@ -706,6 +706,38 @@ func TestRequestAuthScheme(t *testing.T) {
706
706
assertEqual (t , tokenValue , resp .Request .Header .Get (hdrAuthorizationKey ))
707
707
})
708
708
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
+
709
741
}
710
742
711
743
func TestRequestDigestAuth (t * testing.T ) {
0 commit comments