ref issue #58

this will change when we implement chunked transfer encoding