mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Compress HTML responses to Gzip/Deflate if supported by browser
This commit is contained in:
parent
53deb0b8cd
commit
34a3fe426b
40 changed files with 82 additions and 58 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue