Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Initialize Rack::Sendfile with accel mappings #451

Merged
merged 4 commits into from Jan 11, 2013

Conversation

Projects
None yet
2 participants

Instead of requiring the X-Accel-Mapping header to be sent by nginx,
this allows separation of concerns between application and server
configuration.

Example:
config/initializers/rack_sendfile.rb:

Example::Application.configure do
  config.middleware.swap Rack::Sendfile, Rack::Sendfile,
    config.action_dispatch.x_sendfile_header,
    [[Rails.root.join('private', 'uploads'), '/private_uploads']]
end

Alex Rakoczy, Matthew Horan & Ryan Ong and others added some commits Nov 7, 2012

Alex Rakoczy, Matthew Horan & Ryan Ong Initialize Rack::Sendfile with accel mappings
Instead of requiring the X-Accel-Mapping header to be sent by nginx,
this allows separation of concerns between application and server
configuration.
518dc80
Alex Rakoczy & Matthew Horan Make spec_sendfile work with Ruby < 1.9 98ab8e9
Alex Rakoczy & Matthew Horan Additional Ruby 1.8 compaitiblity
Mappings are arrays of arrays to preserve order.
Define to_path on File objects in spec_sendfile.
4d6cb5a

It looks like the jRuby failure is due to this bug: http://jira.codehaus.org/browse/JRUBY-5678.

@raggi raggi added a commit that referenced this pull request Jan 11, 2013

@raggi raggi Minor code review comments closing #451
 * Adds documentation
 * find is preferred over detect
 * Superseded body objects should be closed
82c837a

@raggi raggi merged commit 3b24fa9 into rack:master Jan 11, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment