diff options
author | 2018-07-19 19:27:05 -0700 | |
---|---|---|
committer | 2018-07-19 19:27:05 -0700 | |
commit | 9f6533ece90c6b528dd0af6f1b6dec4a7fa2fa3b (patch) | |
tree | 59349657a1d5a700abab38332d4e7240533ab4d3 /http/response/json/json.go | |
parent | a291d8a38b40569fdd1f00125ca0b29e4b9264f2 (diff) | |
download | v2-9f6533ece90c6b528dd0af6f1b6dec4a7fa2fa3b.tar.gz v2-9f6533ece90c6b528dd0af6f1b6dec4a7fa2fa3b.tar.zst v2-9f6533ece90c6b528dd0af6f1b6dec4a7fa2fa3b.zip |
Compress JSON, CSS and Javascript responses
Diffstat (limited to 'http/response/json/json.go')
-rw-r--r-- | http/response/json/json.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/http/response/json/json.go b/http/response/json/json.go index ff0f06be..6f3eb15c 100644 --- a/http/response/json/json.go +++ b/http/response/json/json.go @@ -9,14 +9,14 @@ import ( "errors" "net/http" + "github.com/miniflux/miniflux/http/response" "github.com/miniflux/miniflux/logger" ) // OK sends a JSON response with the status code 200. -func OK(w http.ResponseWriter, v interface{}) { +func OK(w http.ResponseWriter, r *http.Request, v interface{}) { commonHeaders(w) - w.WriteHeader(http.StatusOK) - w.Write(toJSON(v)) + response.Compress(w, r, toJSON(v)) } // Created sends a JSON response with the status code 201. |