Data source proxy: Fixed issue with Gzip enabled and data source proxy, Fixes #1675

This commit is contained in:
Torkel Ödegaard
2015-04-01 09:00:17 +02:00
parent 5422d13607
commit c3fa68ade8
3 changed files with 23 additions and 1 deletions

20
pkg/middleware/util.go Normal file
View File

@@ -0,0 +1,20 @@
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)
}
}