I'm trying to send a compressed file through AppEngine, my function is
func handleWebGLRequest(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
blobKey, err := blobstore.BlobKeyForFile(c, "/gs/<path>/WebGL.datagz")
if err != nil {
fmt.Fprintf(w, "Problem: cannot find WebGL.data")
return
}
w.Header().Set("Content-Type", "blah/blah/application/octet-stream")
w.Header().Set("Content-Encoding", "gzip")
blobstore.Send(w, blobKey)
}
The file is sent, the content-type appears correctly in the response header with "blah/blah/application/octet-stream", but Content-Encoding is never in the response header, which (I think) is the cause of other issues I'm having.
Does anyone know why it doesn't work?
(In case it matters - I'm using chrome inspector to view the response headers, and here it is, source not parsed
HTTP/1.1 200 OK Content-Type: blah/blah/application/octet-stream Transfer-Encoding: chunked Date: Tue, 28 Apr 2015 06:50:09 GMT Server: Google Frontend Alternate-Protocol: 80:quic,p=1)
Much appreciated