From cdb719673351e10a3ce13b2a5deb151822593c27 Mon Sep 17 00:00:00 2001 From: Chi-Fung Fan Date: Fri, 5 May 2017 17:59:19 +0800 Subject: Sort archive entries for correct MIME detection --- lib/axlsx/package.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index 8a4f29dc..5b5ea14a 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -1,4 +1,4 @@ -# encoding: UTF-8 +# encoding: utf-8 module Axlsx # Package is responsible for managing all the bits and peices that Open Office XML requires to make a valid # xlsx document including valdation and serialization. @@ -253,7 +253,9 @@ module Axlsx parts << {:entry => "xl/#{sheet.rels_pn}", :doc => sheet.relationships, :schema => RELS_XSD} parts << {:entry => "xl/#{sheet.pn}", :doc => sheet, :schema => SML_XSD} end - parts + + # Sort parts for correct MIME detection + parts.sort_by { |part| part[:entry] } end # Performs xsd validation for a signle document -- cgit v1.2.3