Browse Source

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

Torkel Ödegaard 10 years ago
parent
commit
1f330d7753
2 changed files with 2 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      pkg/middleware/auth.go

+ 1 - 0
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)
 

+ 1 - 1
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
 	}