diff options
-rw-r--r-- | go.mod | 1 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | gopherproxy.go | 12 |
3 files changed, 10 insertions, 5 deletions
@@ -1,6 +1,7 @@ | |||
1 | module git.feuerfuchs.dev/Feuerfuchs/gopherproxy | 1 | module git.feuerfuchs.dev/Feuerfuchs/gopherproxy |
2 | 2 | ||
3 | require ( | 3 | require ( |
4 | github.com/NYTimes/gziphandler v1.1.1 | ||
4 | github.com/davidbyttow/govips v0.0.0-20190304175058-d272f04c0fea | 5 | github.com/davidbyttow/govips v0.0.0-20190304175058-d272f04c0fea |
5 | github.com/gobuffalo/packr/v2 v2.1.0 | 6 | github.com/gobuffalo/packr/v2 v2.1.0 |
6 | github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 | 7 | github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 |
@@ -1,3 +1,5 @@ | |||
1 | github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= | ||
2 | github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= | ||
1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | 3 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | 4 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= |
3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | 5 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
diff --git a/gopherproxy.go b/gopherproxy.go index 34e6ff8..c91afdf 100644 --- a/gopherproxy.go +++ b/gopherproxy.go | |||
@@ -21,6 +21,8 @@ import ( | |||
21 | "github.com/gobuffalo/packr/v2" | 21 | "github.com/gobuffalo/packr/v2" |
22 | 22 | ||
23 | "github.com/davidbyttow/govips/pkg/vips" | 23 | "github.com/davidbyttow/govips/pkg/vips" |
24 | |||
25 | "github.com/NYTimes/gziphandler" | ||
24 | ) | 26 | ) |
25 | 27 | ||
26 | type Item struct { | 28 | type Item struct { |
@@ -382,11 +384,11 @@ func ListenAndServe(bind, robotsfile string, robotsdebug bool, vipsconcurrency i | |||
382 | ConcurrencyLevel: vipsconcurrency, | 384 | ConcurrencyLevel: vipsconcurrency, |
383 | }) | 385 | }) |
384 | 386 | ||
385 | http.HandleFunc("/", GopherHandler(tpl, robotsdata, AssetList{styleAsset, jsAsset, fontwAsset, fontw2Asset, propfontwAsset, propfontw2Asset}, robotsdebug, uri)) | 387 | http.Handle("/", gziphandler.GzipHandler(GopherHandler(tpl, robotsdata, AssetList{styleAsset, jsAsset, fontwAsset, fontw2Asset, propfontwAsset, propfontw2Asset}, robotsdebug, uri))) |
386 | http.HandleFunc("/robots.txt", RobotsTxtHandler(robotstxtdata)) | 388 | http.Handle("/robots.txt", gziphandler.GzipHandler(RobotsTxtHandler(robotstxtdata))) |
387 | http.HandleFunc("/favicon.ico", FaviconHandler(favicondata)) | 389 | http.Handle("/favicon.ico", gziphandler.GzipHandler(FaviconHandler(favicondata))) |
388 | http.HandleFunc(styleAsset, StyleHandler(styledata)) | 390 | http.Handle(styleAsset, gziphandler.GzipHandler(StyleHandler(styledata))) |
389 | http.HandleFunc(jsAsset, JavaScriptHandler(jsdata)) | 391 | http.Handle(jsAsset, gziphandler.GzipHandler(JavaScriptHandler(jsdata))) |
390 | http.HandleFunc(fontwAsset, FontHandler(false, fontdataw)) | 392 | http.HandleFunc(fontwAsset, FontHandler(false, fontdataw)) |
391 | http.HandleFunc(fontw2Asset, FontHandler(true, fontdataw2)) | 393 | http.HandleFunc(fontw2Asset, FontHandler(true, fontdataw2)) |
392 | http.HandleFunc(propfontwAsset, FontHandler(false, propfontdataw)) | 394 | http.HandleFunc(propfontwAsset, FontHandler(false, propfontdataw)) |