extend/cowboy — pull request #319 by loe (2012-11-26 22:25:32+00:00)
Title: Client improvements

I'm opening this PR mostly to spur discussion, I don't think this is quality code yet.

I have a relatively poorly behaved server (Rails w/ Rack 1.2.5) that does not send back a Content-Length header or an Transfer-Encoding header. Nginx seems to handle this pretty well when proxying HTTP/1.0 (we are running an older version that does not proxy HTTP/1.1) by reading the whole body. I've attempted to emulate this behavior, but it sucks because I just catch all errors and decide that we're done. The HTTP/1.0 spec isn't really clear on the behavior here, its a grey area.

I think the "long-term" answer is to have a client that can handle HTTP/1.1's chunked encoding responses, which cowboy seems to have the tooling for already, it just needs to be available in the client.

Thanks! I'll continue to use this fork while I play around with my project (https://github.com/loe/boa) and hopefully cowboy:client will come-of-age in the next public release of cowboy.