We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9fb6b7 commit b560e66Copy full SHA for b560e66
lib/zip-container/file.rb
@@ -79,8 +79,13 @@ def initialize(location)
79
#
80
# Create a new ZipContainer file on disk with the specified mimetype.
81
def self.create(filename, mimetype)
82
- ::Zip::OutputStream.open(filename) do |stream|
83
- stream.put_next_entry(MIMETYPE_FILE, nil, nil, ::Zip::Entry::STORED)
+ # The mimetype file must be first in the archive, and uncompressed.
+ 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)
89
stream.write mimetype
90
end
91
0 commit comments