Comment 4 for bug 1628786

Revision history for this message
Nate Finch (natefinch) wrote :

Seems to be a charmstore problem, doesn't happen for already-zipped resources like
https://api.jujucharms.com/charmstore/v5/~containers/kubernetes-master-6/resource/kubernetes/4

but does happen with plaintext resources like
https://api.jujucharms.com/charmstore/v5/~natefinch/starsay-4/resource/data/0

An easy test:

go get npf.io/gorram
gorram -i {{.ContentLength}} net/http Get <url>

Should print the content length, but for resources that aren't gzipped, it prints -1.

you can also use

gorram -i '{{printf "%#v" .}}' net/http Get <url>

to show the full response data (minus body)

Note that curl seems to do some extra processing to get the correct content-length, even though it's not actually in the response.