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

@ -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)

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
}