From 1f330d77534c403af7c3d579eaf47e69a6f1bb8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 1 Apr 2015 15:23:26 +0200 Subject: [PATCH] Basic auth: Fixed issue when using basic auth proxy infront of Grafana, Fixes #1673 --- CHANGELOG.md | 1 + pkg/middleware/auth.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 165f7b40253..1c99d6efef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [Issue #1681](https://github.com/grafana/grafana/issues/1681). MySQL session: fixed problem using mysql as session store - [Issue #1671](https://github.com/grafana/grafana/issues/1671). Data sources: Fixed issue with changing default data source (should not require full page load to take effect, now fixed) - [Issue #1685](https://github.com/grafana/grafana/issues/1685). Search: Dashboard results should be sorted alphabetically +- [Issue #1673](https://github.com/grafana/grafana/issues/1673). Basic auth: Fixed issue when using basic auth proxy infront of Grafana # 2.0.0-Beta1 (2015-03-30) diff --git a/pkg/middleware/auth.go b/pkg/middleware/auth.go index 3d73b15c7f3..9fb09a5c395 100644 --- a/pkg/middleware/auth.go +++ b/pkg/middleware/auth.go @@ -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 }