Made it it compile again
This commit is contained in:
+1
-1
Submodule grafana updated: 526e232c09...2423f470ef
@@ -2,7 +2,6 @@ package middleware
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/Unknwon/macaron"
|
"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 {
|
func (ctx *Context) JsonBody(model interface{}) bool {
|
||||||
b, _ := ioutil.ReadAll(ctx.Req.Body)
|
b, _ := ctx.Req.Body().Bytes()
|
||||||
err := json.Unmarshal(b, &model)
|
err := json.Unmarshal(b, &model)
|
||||||
return err == nil
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ func RenderToPng(c *middleware.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c.Resp.Header().Set("Content-Type", "image/png")
|
c.Resp.Header().Set("Content-Type", "image/png")
|
||||||
http.ServeFile(c.Resp, c.Req, pngPath)
|
http.ServeFile(c.Resp, c.Req.Request, pngPath)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,9 +163,6 @@ func initSessionService() {
|
|||||||
SessionConfig.EnableSetCookie = Cfg.MustBool("session", "enable_set_cookie", true)
|
SessionConfig.EnableSetCookie = Cfg.MustBool("session", "enable_set_cookie", true)
|
||||||
SessionConfig.Gclifetime = Cfg.MustInt64("session", "gc_interval_time", 86400)
|
SessionConfig.Gclifetime = Cfg.MustInt64("session", "gc_interval_time", 86400)
|
||||||
SessionConfig.Maxlifetime = Cfg.MustInt64("session", "session_life_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" {
|
if SessionProvider == "file" {
|
||||||
os.MkdirAll(path.Dir(SessionConfig.ProviderConfig), os.ModePerm)
|
os.MkdirAll(path.Dir(SessionConfig.ProviderConfig), os.ModePerm)
|
||||||
|
|||||||
Reference in New Issue
Block a user