snoyberg/http-enumerator — pull request #38 by erikd (2011-10-26 09:58:57+00:00)
Title: Fix rawBody/transfer-encoding-chunked logic.

The problem I described in issue #37 was that for the case where there the transfer encoding is not chunked it would still end up using a chunked enumeratee due to the Nothing in:

case mcl >>= readMay . S8.unpack of
Just len -> (takeLBS len =$)
Nothing -> (chunkedTerminator =$)

With this patch, we only use chunkedEnumeratee and chunkedTerminator when the transfer encoding is in fact chunked. Otherwise we either use the provided content-length or id (because if is no content-length provided the server should close the connection at the end of the transfer).