We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e1c46e commit 7c82e9bCopy full SHA for 7c82e9b
pkg/operator/endpoints/middleware.go
@@ -67,11 +67,16 @@ func AuthMiddleware(next http.Handler) http.Handler {
67
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
68
authHeader := r.Header.Get("Authorization")
69
70
- if !strings.HasPrefix(authHeader, "CortexAWS") {
+ if authHeader == "" {
71
respondError(w, r, ErrorAuthHeaderMissing())
72
return
73
}
74
75
+ if len(authHeader) < 10 || !strings.HasPrefix(authHeader, "CortexAWS") {
76
+ respondError(w, r, ErrorAuthHeaderMalformed())
77
+ return
78
+ }
79
+
80
parts := strings.Split(authHeader[10:], "|")
81
if len(parts) != 2 {
82
respondError(w, r, ErrorAuthHeaderMalformed())
0 commit comments