jruby-rack icon indicating copy to clipboard operation
jruby-rack copied to clipboard

Incompatibility for Rails request body input stream

Open obfuscoder opened this issue 7 years ago • 0 comments

We have a controller PUT request which is receiving a zip file in the body as binary blob.

Using the rubyzip-gem with MRI we can use this:

Zip::File.open_buffer request.body

The request body is of type StringIO. When running this on JRuby in production mode, we get the following runtime error:

Zip::File.open_buffer expects a String or IO-like argument (responds to tell, seek, read, close). Found: JRuby::Rack::Input (RuntimeError)

I suppose the JRuby rack input implementation does not suppose seeking as the MRI implementation does.

We use JRuby 1.7.23 and Rails 4.2.8 with jruby-rack 1.1.20

obfuscoder avatar May 04 '17 09:05 obfuscoder