lib/regurgitator/local_file.rb in regurgitator-0.6.0 vs lib/regurgitator/local_file.rb in regurgitator-0.7.0
- old
+ new
@@ -1,10 +1,10 @@
# -*- encoding: binary -*-
require "time"
# used to serve local files, bypassing HTTP to the backend device
-class Regurgitator::LocalFile
+class Regurgitator::LocalFile # :nodoc:
# may be called by some Rack web servers to use sendfile(2)
attr_reader :to_path
# used to provide redirects to clients
@@ -36,9 +36,10 @@
headers["Content-Range"] = "bytes #{@range.begin}-#{@range.end}/#{size}"
headers["Content-Length"] = (@range.end - @range.begin + 1).to_s
else
@response[0] = 416
headers["Content-Range"] = "bytes */#{size}"
+ headers["Content-Length"] = '0'
@response << []
return
end
case env["REQUEST_METHOD"]