From 7b320119ba532fd409ec7dade7ad02011c309599 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Wed, 18 Oct 2017 13:15:14 +0100 Subject: Update dependencies --- vendor/google.golang.org/api/gensupport/send.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vendor/google.golang.org/api/gensupport/send.go') diff --git a/vendor/google.golang.org/api/gensupport/send.go b/vendor/google.golang.org/api/gensupport/send.go index 3d22f63..092044f 100644 --- a/vendor/google.golang.org/api/gensupport/send.go +++ b/vendor/google.golang.org/api/gensupport/send.go @@ -5,6 +5,7 @@ package gensupport import ( + "errors" "net/http" "golang.org/x/net/context" @@ -32,6 +33,11 @@ func RegisterHook(h Hook) { // If ctx is non-nil, it calls all hooks, then sends the request with // ctxhttp.Do, then calls any functions returned by the hooks in reverse order. func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + // Disallow Accept-Encoding because it interferes with the automatic gzip handling + // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219. + if _, ok := req.Header["Accept-Encoding"]; ok { + return nil, errors.New("google api: custom Accept-Encoding headers not allowed") + } if ctx == nil { return client.Do(req) } -- cgit v1.2.3