Max
Max

Reputation: 135

No Content-Length field in the HTTP response header (google app engine)

Content-Length header is missing when I try to download rar, exe, msi static files, though response for images contains Content-Length, but if I change rar extension to jpg it doesn't.

How do I solve this?

Upvotes: 8

Views: 5923

Answers (2)

David Underhill
David Underhill

Reputation: 16253

I tried serving a copy of http://googleappengine.googlecode.com/files/GoogleAppEngine_1.3.4.msi as a static fileand experienced the same issue - GAE's response did not include a Content-Length header.

Workaround: If the Content-Length header is critical, then consider hosting your static msi (etc.) file types on a file hosting site (e.g., Dropbox for now.

Edit: This is the intended behavior after all - Nick points out that the files are being transferred with the Transfer-Encoding: Chunked header.

Upvotes: 0

Nick Johnson
Nick Johnson

Reputation: 101149

What headers do you see? It's possible it's being served using Transfer-Encoding: Chunked, which is a perfectly legitimate way of transferring responses over HTTP.

Also, how are you serving the file - using static files, your code, or the blobstore?

Upvotes: 7

Related Questions