$ cat config.ru
use Rack::Sendfile, 'X-Sendfile'
class Bam
def to_path
'/path/to/video.mp4'
end
end
run Proc.new {|env| [200, {}, Bam.new]}
# 200 instead of 206
# whole file is served
$ curl --range 0-2 -i http://pow.dev/ -o /dev/null
However, files in public/ folder responds to Range request correctly.
$ ls public
video.mp4
# 206
# partial file is served
$ curl --range 0-2 -i http://pow.dev/video.mp4 -o /dev/null
Workaround is to use Rack::File instead of Rack::Sendfile.
Fail to play video with pow due to range request not processed correctly as mentioned here http://stackoverflow.com/questions/16450616/what-is-the-proper-way-to-serve-mp4-files-through-rails-to-an-ipad#answer-16593030
However, files in public/ folder responds to Range request correctly.
Workaround is to use Rack::File instead of Rack::Sendfile.