#9 Active Storage - io must be rewindable

This commit is contained in:
Karel Pičman 2025-11-27 14:29:20 +01:00
parent 9e5fcaa4e0
commit 13b1e05c55

View File

@ -633,6 +633,7 @@ module RedmineDmsf
if request.body.respond_to?(:rewind) if request.body.respond_to?(:rewind)
new_revision.copy_file_content request.body new_revision.copy_file_content request.body
else # A workaround for Webrick that doesn't support rewind else # A workaround for Webrick that doesn't support rewind
Rails.logger.info ">>> A workaround for Webrick that doesn't support rewind"
stream = StringIO.new stream = StringIO.new
while (buffer = request.body.read(8_192)) while (buffer = request.body.read(8_192))
stream.write buffer stream.write buffer