mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 20:54:22 -06:00
22 lines
371 B
Go
22 lines
371 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()
|
|
// ignore datasource proxy requests
|
|
if strings.HasPrefix(requestPath, "/api/datasources/proxy") {
|
|
return
|
|
}
|
|
|
|
ctx.Invoke(macaronGziper)
|
|
}
|
|
}
|