-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously if we passed in an IO object which doesn't respond to #seek, MimeMagic would read the whole IO into memory. And this is exactly the type of objects that the Shrine file upload library deals with. However, we can also "seek" by blank-reading that many bytes, and always rewinding to the beginning, which is what we've implemented in this change. This change also doesn't require IOs to respond to #binmode.
- Loading branch information
Showing
2 changed files
with
10 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters