Honor Accept-Encoding header in gzip transcoder
This avoids sending compressed data to clients which do not support it.
This commit is contained in:
@ -3,11 +3,12 @@ package transcoder
|
||||
import (
|
||||
"github.com/barnacs/compy/proxy"
|
||||
"image/png"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Png struct{}
|
||||
|
||||
func (t *Png) Transcode(w *proxy.ResponseWriter, r *proxy.ResponseReader) error {
|
||||
func (t *Png) Transcode(w *proxy.ResponseWriter, r *proxy.ResponseReader, headers http.Header) error {
|
||||
img, err := png.Decode(r)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user