Configuration
- Rails: 4.2.7.1
- Puma: 3.8.2
--
Transfer-Encoding: chunked
I've been unable to make this work and unable to find a definitive answer: in the above configuration, I want to stream large amounts of data to the client (in the response) - is this supported?
- If so, what is my responsibility?
- Should my controller be emitting hexadecimal chunk sizes,
\r\n
,0
etc?
- Should my controller be emitting hexadecimal chunk sizes,
- It feels like I want but can't find a simple response API like:
write
,write
,write
,flush
write
,write
,write
,flush
close
- I've read 100 posts about Rack, monkey patching and other insanity
- I've read about Puma and/or Rack mangling the encoding, possibly gzip/deflating in the wrong order
- This seems like a simple feature that should be readily available but I am stumped
- I have created numerous tests, e.g.
self.response_body = Enumerator.new
andresponse.stream.write
, etc. -- all with similar results (viacurl
) -Malformed encoding found in chunked-encoding
ortransfer closed with outstanding read data remaining
Can anyone show me the light?