diff --git a/README.md b/README.md index 06a7601..f48d23e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ import ( "time" "github.com/gin-contrib/gzip" - "github.com/gin-gonic/gin" + "github.com/gin-gonic/gin.v1" ) func main() { diff --git a/gzip.go b/gzip.go index 15fd2ae..0b54bba 100644 --- a/gzip.go +++ b/gzip.go @@ -8,7 +8,7 @@ import ( "strings" "sync" - "github.com/gin-gonic/gin" + "gopkg.in/gin-gonic/gin.v1" ) const ( @@ -37,6 +37,7 @@ func Gzip(level int) gin.HandlerFunc { gz.Reset(c.Writer) c.Header("Content-Encoding", "gzip") + c.Header("Content-Type", "text/html; charset=UTF-8") c.Header("Vary", "Accept-Encoding") c.Writer = &gzipWriter{c.Writer, gz} defer func() { @@ -70,7 +71,7 @@ func shouldCompress(req *http.Request) bool { } switch extension { - case ".png", ".gif", ".jpeg", ".jpg": + case ".png", ".gif", ".jpeg", ".jpg", ".css", ".js": return false default: return true