Skip to content

Commit b560e66

Browse files
committed
Remove internal workaround for uncompressed zip entries.
1 parent a9fb6b7 commit b560e66

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/zip-container/file.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,13 @@ def initialize(location)
7979
#
8080
# Create a new ZipContainer file on disk with the specified mimetype.
8181
def self.create(filename, mimetype)
82-
::Zip::OutputStream.open(filename) do |stream|
83-
stream.put_next_entry(MIMETYPE_FILE, nil, nil, ::Zip::Entry::STORED)
82+
# The mimetype file must be first in the archive, and uncompressed.
83+
mimetype_entry = Zip::Entry.new(
84+
nil, MIMETYPE_FILE, compression_method: Zip::Entry::STORED
85+
)
86+
87+
Zip::OutputStream.open(filename) do |stream|
88+
stream.put_next_entry(mimetype_entry)
8489
stream.write mimetype
8590
end
8691

0 commit comments

Comments
 (0)