This project is archived and is in readonly mode.
[PATCH] Fix accidental caching of proc objects instead of the content it represents
Reported by Tom Lea | May 1st, 2009 @ 01:03 AM | in 3.x
Streaming content will return a proc that rack handles just fine, but cache_page expects a string.
This exhibits itself by caching the following instead of the expected file contents:
#<Proc:0x01a10f80@./test/../lib/action_controller/streaming.rb:91>
This can be avoided by setting :stream => false when calling send_file. But the problem only became apparent after we got to production... which is too late IMHO.
It should be noted that this is not an issue in 3.0, due to some more major changes in the rack stack (I think). The patch when applied to 3.0 does not cause any test fails, but neither does just applying the test. Maybe a reversion should be applied to the 3-0 branch?
Patch with tests attached.
Comments and changes to this ticket
-
Rohit Arondekar October 9th, 2010 @ 04:23 AM
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>