mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
21 lines
333 B
Go
21 lines
333 B
Go
|
package middleware
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
|
||
|
"github.com/Unknwon/macaron"
|
||
|
)
|
||
|
|
||
|
func Gziper() macaron.Handler {
|
||
|
macaronGziper := macaron.Gziper()
|
||
|
|
||
|
return func(ctx *macaron.Context) {
|
||
|
requestPath := ctx.Req.URL.RequestURI()
|
||
|
if strings.HasPrefix(requestPath, "/api/datasources/proxy") {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
ctx.Invoke(macaronGziper)
|
||
|
}
|
||
|
}
|