small fix, don't worry about it

This commit is contained in:
Tomas Dvorak
2026-04-10 12:06:24 +02:00
commit 5c500a72b0
243 changed files with 44176 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package handlers
import "strings"
func bearerToken(header string) (string, bool) {
trimmed := strings.TrimSpace(header)
if trimmed == "" {
return "", false
}
parts := strings.SplitN(trimmed, " ", 2)
if len(parts) != 2 || !strings.EqualFold(parts[0], "Bearer") {
return "", false
}
token := strings.TrimSpace(parts[1])
if token == "" {
return "", false
}
return token, true
}