The code which reproduces this case https://github.com/benoitc/hackney/issues/81#issuecomment-35783975