252
279
// or close connection when finished, since multipart is not supported yet
254
281
case chunked(t.TransferEncoding):
255
t.Body = &body{Reader: newChunkedReader(r), hdr: msg, r: r, closing: t.Close}
282
t.Body = &body{Reader: NewChunkedReader(r), hdr: msg, r: r, closing: t.Close}
256
283
case t.ContentLength >= 0:
257
284
// TODO: limit the Content-Length. This is an easy DoS vector.
258
285
t.Body = &body{Reader: io.LimitReader(r, t.ContentLength), closing: t.Close}