lib/rack/file.rb in rack-2.0.1 vs lib/rack/file.rb in rack-2.0.2

- old
+ new

@@ -156,10 +156,10 @@ Mime.mime_type(::File.extname(path), default_mime) end def filesize path # If response_body is present, use its size. - return Rack::Utils.bytesize(response_body) if response_body + return response_body.bytesize if response_body # We check via File::size? whether this file provides size info # via stat (e.g. /proc files often don't), otherwise we have to # figure it out by reading the whole file into memory. ::File.size?(path) || ::File.read(path).bytesize