From 34a3fe426b33a63f2d8e02d4a70c88f137fa5410 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 6 Jul 2018 20:39:28 -0700 Subject: Compress HTML responses to Gzip/Deflate if supported by browser --- http/response/html/html.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'http/response/html') 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. -- cgit v1.2.3