Honor Accept-Encoding header in gzip transcoder
This avoids sending compressed data to clients which do not support it.
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"github.com/tdewolff/minify/css"
|
||||
"github.com/tdewolff/minify/html"
|
||||
"github.com/tdewolff/minify/js"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Minifier struct {
|
||||
@ -24,6 +25,6 @@ func NewMinifier() *Minifier {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Minifier) Transcode(w *proxy.ResponseWriter, r *proxy.ResponseReader) error {
|
||||
func (t *Minifier) Transcode(w *proxy.ResponseWriter, r *proxy.ResponseReader, headers http.Header) error {
|
||||
return t.m.Minify(r.ContentType(), w, r)
|
||||
}
|
||||
|
Reference in New Issue
Block a user