Do you have some documentation pointing to this? as far as I know you
need to handle the reader yourself which is pretty easy.
I forked your gist and provided an example. see
package main
import (
"compress/gzip"
"net/http"
)
func main() {
req, err := http.NewRequest("GET",
"http://bash.cyberciti.biz/wp-content/themes/bashshell/custom/images/headerbg.gif",
nil)
if err != nil {
panic(err)
}
req.Header.Set("Accept-Encoding", "gzip")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
if res.Header.Get("Content-Encoding") == "gzip" {
res.Body, err = gzip.NewReader(res.Body)
if err != nil {
panic(err)
}
defer res.Body.Close()
}
// ...
}
(Don't forget to close both readers!)
Some points: