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

Sendfile Range request #539

@khoan

Description

@khoan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions