aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--go.mod1
-rw-r--r--go.sum2
-rw-r--r--gopherproxy.go12
3 files changed, 10 insertions, 5 deletions
diff --git a/go.mod b/go.mod
index bccf9dd..b8e8baf 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,7 @@
1module git.feuerfuchs.dev/Feuerfuchs/gopherproxy 1module git.feuerfuchs.dev/Feuerfuchs/gopherproxy
2 2
3require ( 3require (
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
diff --git a/go.sum b/go.sum
index 4c96b62..544eee6 100644
--- a/go.sum
+++ b/go.sum
@@ -1,3 +1,5 @@
1github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
2github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
1github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 4github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 5github.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
26type Item struct { 28type 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))