Basic auth: Fixed issue when using basic auth proxy infront of Grafana, Fixes #1673

This commit is contained in:
Torkel Ödegaard
2015-04-01 15:23:26 +02:00
parent cf877e6567
commit 1f330d7753
2 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,7 @@ func getRequestUserId(c *Context) int64 {
func getApiKey(c *Context) string {
header := c.Req.Header.Get("Authorization")
parts := strings.SplitN(header, " ", 2)
if len(parts) == 2 || parts[0] == "Bearer" {
if len(parts) == 2 && parts[0] == "Bearer" {
key := parts[1]
return key
}