Hi Trevor,

Keenan is right in that Heroku doesn't support the X-sendfile method:

- http://devcenter.heroku.com/articles/rack-sendfile

The support team initially added this documentation last year after I
submitted an issue regarding problems I was having serving Sass-
generated files from `./tmp` using Rack::Static. The relevant part of
my Rails configuration looked like this:

    Sass::Plugin.options[:template_location] = {
    "#{Rails.root}/app/stylesheets" => "#{Rails.root}/tmp/stylesheets"
    }

    Rails.configuration.middleware.insert_after 'Sass::Plugin::Rack',
      'Rack::Static', :urls => ['/stylesheets'], :root =>
"#{Rails.root}/tmp"

This worked in a simple Rack app, but not in Rails--I kept getting a
503 error. A member of the Heroku support team suggested that I remove
Rack::Sendfile from my middleware stack, and that solved the issue.
Since Rack::Static delegates to Rack::File, Rack::Sendfile will add
the `X-Sendfile` header. And since Heroku doesn't support the use of
Rack::Sendfile, file downloads will fail.

When I first found about this, I just removed Rack::Sendfile from my
middleware stack, but it seems Heroku is now getting round this
automatically by configuring Rails to disable the `X-Sendfile` header.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to