aboutsummaryrefslogtreecommitdiff
path: root/vendor/cloud.google.com/go/storage/not_go17.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/cloud.google.com/go/storage/not_go17.go')
-rw-r--r--vendor/cloud.google.com/go/storage/not_go17.go7
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") == ""
+}