rack-gridfs icon indicating copy to clipboard operation
rack-gridfs copied to clipboard

Content-Length header is missing

Open steverandy opened this issue 12 years ago • 3 comments

steverandy avatar Jul 15 '12 07:07 steverandy

Please give more background on the case where you observe this. If an enumerable object (which includes something that acts like a File) is given, we stream the response with chunked encoding, which does not supply Content-Length by definition. This is common behavior in Rack components and is probably sensible/desirable for most GridFS use cases.

ches avatar Jul 16 '12 10:07 ches

However -- not looking closely at the implementation, but -- we could certainly make it possible to explicitly override Transfer-Encoding to not use chunked if expressly desired, if we're not allowing for that already. Patches welcome if you need that :wink:

ches avatar Jul 16 '12 10:07 ches

I'm using rack-grids to serve video files that is cached by nginx (proxy cache). The problem is that it won't play on iOS because there is a requirement for byte range request.

After further reading, I read that nginx does byte range request automatically for static file and requires content-length header.

Is there a better way to serve videos from GridFS that also supports iOS devices? I'm developing a simple CMS (https://github.com/steverandy/concen) that keep all the files on GridFS for simplicity.

steverandy avatar Jul 16 '12 10:07 steverandy