diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-08-23 22:51:21 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-24 13:45:03 +0100 |
commit | f8e3dea19012ccf05965d10255789eec33c2ebcf (patch) | |
tree | 8522ceada8bc7270648f29615b89550db910cb6c /vendor/cloud.google.com/go/storage/not_go17.go | |
parent | 91f9bc722152146466523861162b85195f99875b (diff) |
Update deps
Diffstat (limited to 'vendor/cloud.google.com/go/storage/not_go17.go')
-rw-r--r-- | vendor/cloud.google.com/go/storage/not_go17.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/cloud.google.com/go/storage/not_go17.go b/vendor/cloud.google.com/go/storage/not_go17.go index 0efb3e9..28b5847 100644 --- a/vendor/cloud.google.com/go/storage/not_go17.go +++ b/vendor/cloud.google.com/go/storage/not_go17.go @@ -24,3 +24,10 @@ func withContext(r *http.Request, _ interface{}) *http.Request { // In Go 1.6 and below, ignore the context. return r } + +// Go 1.6 doesn't have http.Response.Uncompressed, so we can't know whether the Go +// HTTP stack uncompressed a gzip file. As a good approximation, assume that +// the lack of a Content-Length header means that it did uncompress. +func goHTTPUncompressed(res *http.Response) bool { + return res.Header.Get("Content-Length") == "" +} |