Set the content length automatically before calling wrap_file
Fixed a whole bunch of resource warnings in the flask testsuite