extend/cowboy — pull request #662 by nlebedenco (2014-01-23 23:07:25+00:00)
Title: Fix crash in stream_body/2 when transfer coding is unknonwn

stream_body/2 is called from skip_body/1 when a request body is not
processed. If a request is rejected but contains an unknown transfer-encoding
for which init_stream wasn't called, stream_body/2 will crash due to a case_clause
violation trying to match only agaist [<<"identity">>] or ["chunked"].
I added a clause to handle unknown encodings and return {error, badencoding}
so that cowboy can close the connection gracefully.
Code also handles errors returned from parse_header now for completeness.