diff --git a/grafana b/grafana index 526e232c097..2423f470ef6 160000 --- a/grafana +++ b/grafana @@ -1 +1 @@ -Subproject commit 526e232c097eb45c484c9d1387813ff4f05d4a14 +Subproject commit 2423f470ef62145c26e74511121eac01e554c363 diff --git a/pkg/middleware/middleware.go b/pkg/middleware/middleware.go index f9d4705f515..619f5200bd8 100644 --- a/pkg/middleware/middleware.go +++ b/pkg/middleware/middleware.go @@ -2,7 +2,6 @@ package middleware import ( "encoding/json" - "io/ioutil" "strconv" "github.com/Unknwon/macaron" @@ -81,7 +80,7 @@ func (ctx *Context) JsonApiErr(status int, message string, err error) { } func (ctx *Context) JsonBody(model interface{}) bool { - b, _ := ioutil.ReadAll(ctx.Req.Body) + b, _ := ctx.Req.Body().Bytes() err := json.Unmarshal(b, &model) return err == nil } diff --git a/pkg/routes/api/api_render.go b/pkg/routes/api/api_render.go index b0cc7a7954a..16657b207e7 100644 --- a/pkg/routes/api/api_render.go +++ b/pkg/routes/api/api_render.go @@ -28,5 +28,5 @@ func RenderToPng(c *middleware.Context) { } c.Resp.Header().Set("Content-Type", "image/png") - http.ServeFile(c.Resp, c.Req, pngPath) + http.ServeFile(c.Resp, c.Req.Request, pngPath) } diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 7b484decea2..16184cfb9bc 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -163,9 +163,6 @@ func initSessionService() { SessionConfig.EnableSetCookie = Cfg.MustBool("session", "enable_set_cookie", true) SessionConfig.Gclifetime = Cfg.MustInt64("session", "gc_interval_time", 86400) SessionConfig.Maxlifetime = Cfg.MustInt64("session", "session_life_time", 86400) - SessionConfig.SessionIDHashFunc = Cfg.MustValueRange("session", "session_id_hashfunc", - "sha1", []string{"sha1", "sha256", "md5"}) - SessionConfig.SessionIDHashKey = Cfg.MustValue("session", "session_id_hashkey", string(com.RandomCreateBytes(16))) if SessionProvider == "file" { os.MkdirAll(path.Dir(SessionConfig.ProviderConfig), os.ModePerm)