File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -517,17 +517,17 @@ func server(cmd *cobra.Command, args []string) {
517517 if sec .Type == "http" {
518518 // Prefixes for each scheme.
519519 prefixes := map [string ]string {
520- "bearer" : "Bearer " ,
521- "basic" : "Basic " ,
520+ "bearer" : "BEARER " ,
521+ "basic" : "BASIC " ,
522522 }
523523 if prefix , ok := prefixes [sec .Scheme ]; ok {
524524 auth := req .Header .Get ("Authorization" )
525525 // If the auth is missing
526526 if len (auth ) == 0 {
527527 return ErrMissingAuth
528528 }
529- // If the auth doesn't have a value or doesn't start with the prefix
530- if len (auth ) <= len (prefix ) || ! strings .HasPrefix (auth , prefix ) {
529+ // If the auth doesn't have a value or doesn't start with the case insensitive prefix
530+ if len (auth ) <= len (prefix ) || ! strings .HasPrefix (strings . ToUpper ( auth ) , prefix ) {
531531 return ErrInvalidAuth
532532 }
533533 }
You can’t perform that action at this time.
0 commit comments