Skip to content

Commit

Permalink
Merge pull request #161 from nbtca/fix-strip-token
Browse files Browse the repository at this point in the history
fix: fix parse token
  • Loading branch information
wen-templari authored Feb 16, 2025
2 parents 0138c95 + b39a707 commit 529d850
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func CreateBasicAuth(username, password string) string {

func GetTokenString(token string) (string, error) {
prefix := "Bearer "
if !strings.HasPrefix(token, prefix) {
if !strings.HasPrefix(token, prefix) && !strings.HasPrefix(token, strings.ToLower(prefix)) {
return "", fmt.Errorf("unexpected token: %v", token)
}
tokenString := token[len(prefix):]
Expand Down

0 comments on commit 529d850

Please # to comment.