dekellum/fishwife — Issue #4: rack.input does not rewind
Author: dekellum
Created: 2012-02-13 01:10:48+00:00
State: open

This issue was first raised in [matadon/mizuno#15](https://github.com/matadon/mizuno/issues/15) and 5b22977 suggests a fix. However my review and testing finds that RewindableInputStream.to_io (from jruby-rack, kirk, et al) also will not yield a functioning `rewind`. The kirk original also includes ReweindableInputStream to IO adapter (see its input_stream.rb.) So either that needs to be co-opted here, or a better performing JRuby java extension for InputStream to IO implemented.

Also I would prefer to not use temp files for input caching accept in exceptional cases. An in memory implementation with configurable rewind limit might resolve the issue for 99% of use cases without the performance and complexity impact.

[JRUBY-5891](http://jira.codehaus.org/browse/JRUBY-5891) is related. However JRUBY is not going to fix this: InputStream.to_io is not going to support rewind without major changes and assumptions.