#8 ✓resolved
Ryan Tomayko

[PATCH] Document body.to_path in SPEC

Reported by Ryan Tomayko | December 28th, 2008 @ 10:00 AM | in 1.0

For bodies that have a corresponding file on disk (Rack::File, Rails-like #send_file implementations, etc.), it's useful to have the option of using low-level system calls like sendfile(2) or the X-Sendfile support built into most web servers. In order to do this, we need a reliable way of determining if a body has an on-disk representation.

This was discussed in more detail on the mailing list:


The following patch adds a note to the SPEC to make body.to_path explicitly supported:

If the Body responds to #to_path, it must return a String identifying
the location of a file whose contents are identical to that produced
by calling #each.

Rack::File has been modified to produce bodies that respond to #to_path and Rack::Lint checks that the files given in #to_path exist and will WARN on rack.errors if not.


Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket