Comment 1 for bug 1474271

Revision history for this message
Martin Pitt (pitti) wrote :

This is frustratingly hard. I tried to upload both log.gz and log.txt.gz with various MIME types such as text/plain, application/gzip, or text/x-gzip-plain, and none of that works. The correct thing would be

  Content-Type: text/plain; charset=UTF-8
  Content-Encoding: gzip

but then the browser only gets the content type and either doesn't get content-encoding sent, or it ignores it. Thus you see the gzipped contents inline, which isn't helpful.

In case me or someone else wants to play around with that further, this is what I use:

Get SWIFT_URL and TOKEN from "swift stat -v"

curl -i $SWIFT_URL/stuff/log.txt.gz -X PUT -H "Content-Length: 1" -H "Content-Type: text/plain; charset=UTF-8" -H "Content-Encoding: gzip" -H "X-Auth-Token: $TOKEN" -T /tmp/log.gz