aboutsummaryrefslogtreecommitdiffhomepage
path: root/http/response/html/html.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-07-06 20:39:28 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-07-06 20:39:28 -0700
commit34a3fe426b33a63f2d8e02d4a70c88f137fa5410 (patch)
tree108ea6897543f2119747da1ef900d55253881e2c /http/response/html/html.go
parent53deb0b8cd1899ec325eca93631b3e137bdd3ec3 (diff)
Compress HTML responses to Gzip/Deflate if supported by browser
Diffstat (limited to 'http/response/html/html.go')
-rw-r--r--http/response/html/html.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/http/response/html/html.go b/http/response/html/html.go
index 4f605e8..a17ce04 100644
--- a/http/response/html/html.go
+++ b/http/response/html/html.go
@@ -7,13 +7,14 @@ package html
import (
"net/http"
+ "github.com/miniflux/miniflux/http/response"
"github.com/miniflux/miniflux/logger"
)
// OK writes a standard HTML response.
-func OK(w http.ResponseWriter, b []byte) {
+func OK(w http.ResponseWriter, r *http.Request, b []byte) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
- w.Write(b)
+ response.Compress(w, r, b)
}
// ServerError sends a 500 error to the browser.