Shrine 3.5.0 does not support Rack 3 (undefined method `map' for #Rack::Files::Iterator)
vrodic opened this issue · comments
When using a Rails 7 application with Rack 3 and Shrine 3.5.0 we are getting a
NoMethodError
undefined method `map' for #<Rack::Files::Iterator:0x0000786dd78a7560 @path="/tmp/image_processing20240221-90664-78pq2t.jpg", @ranges=[0..1343], @options={:mime_type=>"image/jpeg", :size=>1344}>
shrine (3.5.0) lib/shrine/plugins/derivation_endpoint.rb:368:in `call`
This is the offending line:
headers["Content-Length"] ||= body.map(&:bytesize).inject(0, :+).to_s
I see there are already PRs to fix this:
see #682
Should be fixed by #682.