chore: avoid aliasing models in middleware (#22484)

This commit is contained in:
Carl Bergquist
2020-02-28 12:50:58 +01:00
committed by GitHub
parent 8b9b67f248
commit f2f2722bb1
15 changed files with 74 additions and 74 deletions

View File

@ -1,14 +1,14 @@
package middleware
import (
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/models"
macaron "gopkg.in/macaron.v1"
)
const HeaderNameNoBackendCache = "X-Grafana-NoCache"
func HandleNoCacheHeader() macaron.Handler {
return func(ctx *m.ReqContext) {
return func(ctx *models.ReqContext) {
ctx.SkipCache = ctx.Req.Header.Get(HeaderNameNoBackendCache) == "true"
}
}