Skip to content

Match OOXML ZIP part names case-insensitively - #193

Open
afurm wants to merge 1 commit into
rails:mainfrom
afurm:fix-zip-part-name-case
Open

afurm wants to merge 1 commit into
rails:mainfrom
afurm:fix-zip-part-name-case

Conversation

@afurm

@afurm afurm commented Oct 16, 2026

Copy link
Copy Markdown

Summary

OPC (ECMA-376) treats package part names as case-insensitive. ZIP central-directory refinement compared entry names with a case-sensitive include?, so archives whose parts were stored as Word/Document.xml or XL/VBAProject.bin stayed on application/x-tika-ooxml (or a non-macro Office type) instead of refining to the document family.

I downcase central-directory entry names before matching them against the discriminating part list, and keep that list in lowercase so the conventional vbaProject.bin spelling still matches.

Test plan

  • bundle exec rake test (682 runs, 0 failures)
  • Added coverage for mixed-case document parts and mixed-case macro parts

OPC (ECMA-376) treats package part names as case-insensitive. Archives whose
central directory lists Word/Document.xml or XL/VBAProject.bin were left as
application/x-tika-ooxml or a non-macro Office type. Downcase entry names
before comparing them to the discriminating part list.
@afurm

afurm commented Oct 31, 2026

Copy link
Copy Markdown
Author

The failing head job looks environmental, not related to this change: it died during bundle install under the 2026-10-15 ruby-head snapshot (BUNDLE_FROZEN with gemfiles/runtime/Gemfile), before any tests ran. That job is marked experimental (continue-on-error), and the same lockfile installs fine on 3.3, 3.4, 4.0, jruby, jruby-head and truffleruby. Nothing here touches dependency resolution. A re-run against a current ruby-head should go green.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant