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

2

8

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?

Middleclass answered 12/6, 2010 at 20:3 Comment(0)
K
7

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?

Kingdom answered 13/6, 2010 at 8:38 Comment(1)
You are right, it was about static files and Transfer-Encoding: Chunked. After creating a script for serving files, everything worked out and now Content-Length header is sent to the client. ThanksMiddleclass
C
0

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.

Campanulaceous answered 12/6, 2010 at 20:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.