Skip to content

Commit

Permalink
Fix to return an error response when Transfer-Encoding and Content-Le…
Browse files Browse the repository at this point in the history
…ngth both headers are present. Fix #111
  • Loading branch information
mopemope committed May 17, 2020
1 parent 4155876 commit 3bc3e7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions meinheld/server/http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,10 @@ size_t http_parser_execute (http_parser *parser,
* we have to simulate it by handling a change in errno below.
*/
if (settings->on_headers_complete) {
if(parser->set_content_length == 1 && parser->flags & F_CHUNKED){
return -1;
}

switch (settings->on_headers_complete(parser)) {
case 0:
break;
Expand Down

0 comments on commit 3bc3e7c

Please sign in to comment.