From 4a8a70dde0f6fd7c5409766d30e6cc932b43b7c8 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 13 Oct 2014 18:04:07 -0400 Subject: [PATCH] Fix gzip --- .gopmfile | 8 ++++---- cmd/web.go | 8 ++++---- conf/app.ini | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gopmfile b/.gopmfile index 8f13d5157..2455f1041 100644 --- a/.gopmfile +++ b/.gopmfile @@ -7,8 +7,8 @@ github.com/beego/redigo = commit:856744a0d5 github.com/Unknwon/cae = commit:2e70a1351b github.com/Unknwon/com = commit:2cbcbc6916 github.com/Unknwon/goconfig = commit:0f8d8dc1c0 -github.com/Unknwon/i18n = commit:47baeff8d0 -github.com/Unknwon/macaron = commit:4927b78ad9 +github.com/Unknwon/i18n = +github.com/Unknwon/macaron = github.com/codegangsta/cli = commit:7381bc4e62 github.com/go-sql-driver/mysql = commit:8111ee3ec3 github.com/go-xorm/core = commit:750aae0fa5 @@ -18,9 +18,9 @@ github.com/gogits/oauth2 = commit:99cbec870a github.com/lib/pq = commit:b021d0ef20 github.com/macaron-contrib/cache = commit:204d8e5137 github.com/macaron-contrib/captcha = commit:d37d37eeea -github.com/macaron-contrib/csrf = commit:8e980822b0 +github.com/macaron-contrib/csrf = github.com/macaron-contrib/i18n = commit:2246f45894 -github.com/macaron-contrib/session = commit:42ad41e323 +github.com/macaron-contrib/session = github.com/macaron-contrib/toolbox = commit:57127bcc89 github.com/mattn/go-sqlite3 = commit:a80c27ba33 github.com/nfnt/resize = commit:581d15cb53 diff --git a/cmd/web.go b/cmd/web.go index 395658f6e..f5843f5f3 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -63,7 +63,7 @@ func checkVersion() { // Check dependency version. macaronVer := git.MustParseVersion(strings.Join(strings.Split(macaron.Version(), ".")[:3], ".")) - if macaronVer.LessThan(git.MustParseVersion("0.2.0")) { + if macaronVer.LessThan(git.MustParseVersion("0.2.3")) { log.Fatal(4, "Package macaron version is too old, did you forget to update?(github.com/Unknwon/macaron)") } i18nVer := git.MustParseVersion(i18n.Version()) @@ -81,15 +81,15 @@ func newMacaron() *macaron.Macaron { m := macaron.New() m.Use(macaron.Logger()) m.Use(macaron.Recovery()) + if setting.EnableGzip { + m.Use(macaron.Gziper()) + } m.Use(macaron.Static( path.Join(setting.StaticRootPath, "public"), macaron.StaticOptions{ SkipLogging: !setting.DisableRouterLog, }, )) - // if setting.EnableGzip { - // m.Use(macaron.Gzip()) - // } m.Use(macaron.Renderer(macaron.RenderOptions{ Directory: path.Join(setting.StaticRootPath, "templates"), Funcs: []template.FuncMap{base.TemplateFuncs}, diff --git a/conf/app.ini b/conf/app.ini index d8bbeb70a..79f440dd4 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -28,7 +28,7 @@ KEY_FILE = custom/https/key.pem ; default is the path where Gogs is executed STATIC_ROOT_PATH = ; Application level GZIP support -#ENABLE_GZIP = false +ENABLE_GZIP = false [database] ; Either "mysql", "postgres" or "sqlite3", it's your choice