6 Commits

Author SHA1 Message Date
Alex Guerra
7fb5d3b261 Implement io.ReaderFrom on responseWriter
The private ResponseWriter implementation in the stdlib implements this
interface to enable some optimizations around sendfile. The interface is
asserted for in io.Copy, probably the most common way to serve files, so
without this method we are missing out on those optimizations. As we're
only interested in writing the headers and capturing the number of bytes
written, we can just call io.Copy on the wrapped http.ResponseWriter and
it will do the right thing, calling ReadFrom if it's implemented and
doing a regular copy if not.
2016-06-14 20:40:54 -05:00
Alex Guerra
e66f3b5a53 Replace all instances of testWritter with testWriter 2016-06-14 20:10:46 -05:00
Manu Mtz-Almeida
0cb52ccef7 Improves unit test coverage 2015-05-19 02:29:32 +02:00
Manu Mtz-Almeida
0a192fb0fa Tons of unit tests 2015-04-09 12:15:02 +02:00
Manu Mtz-Almeida
c61c547539 More unit tests for ResponseWriter 2015-04-08 15:20:39 +02:00
Manu Mtz-Almeida
4d315f474b More unit tests 2015-04-08 14:24:49 +02:00