mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Compress JSON, CSS and Javascript responses
This commit is contained in:
parent
a291d8a38b
commit
9f6533ece9
14 changed files with 41 additions and 35 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue