Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection for .mdb and .accdb files #50

Merged
merged 1 commit into from
May 17, 2021
Merged

Conversation

gmcgibbon
Copy link
Member

#44

Fixes magic and name detection for mdb and accdb files. Marcel 0.3.3 detected mdb files as application/vnd.ms-access, which is restored. However, accdb was previously application/octet-stream. This patch also registers support for this extension with correct magic detection. If you hexdump -C access files you'll find \x00\x01\x00\xStandard Jet DB or \x00\x01\x00\xStandard ACE DB as a prefix, which previously got caught in our magic override for TTFs: Marcel::MimeType.extend "font/ttf", magic: [[0, "\x00\x01\x00\x00"]], extensions: %w( ttf ttc ).

@pixeltrix pixeltrix merged commit a857808 into rails:main May 17, 2021
@gmcgibbon gmcgibbon deleted the mdb_accdb branch May 17, 2021 16:08

Marcel::MimeType.extend(
"application/vnd.ms-access",
extensions: %w( mdb accdb ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmcgibbon I missed this - should mde and accde be in this list too? They're the compiled versions of mdb and accdb files.

Copy link
Member Author

@gmcgibbon gmcgibbon May 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add those extensions, but it also depends what the hexdumped contents are for magic detection. I'll try playing with a trial of MS access to see if I can get more fixtures to test out.

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.

2 participants