Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

Sendfile Range request #539

Open
khoan opened this issue Mar 6, 2017 · 1 comment
Open

Sendfile Range request #539

khoan opened this issue Mar 6, 2017 · 1 comment

Comments

@khoan
Copy link

khoan commented Mar 6, 2017

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

$ 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.

@speedmax
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants