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

Weight not respected #165

Open
justinlittman opened this issue Jan 6, 2022 · 0 comments
Open

Weight not respected #165

justinlittman opened this issue Jan 6, 2022 · 0 comments

Comments

@justinlittman
Copy link

My apologies if my understanding of freedesktop.org.xml / mimemagic is incorrect, but mimemagic appears not to respect weight when looking up a mimetype by extension.

With the latest freedesktop.org.xml:

MimeMagic.by_path("spec/fixtures/test2/00000001.html").type
"application/xhtml+xml"

While "application/xhtml+xml" appears first in the file, "text/html" has a higher weight:

<glob pattern="*.html" weight="80"/>
    <glob pattern="*.htm" weight="80"/>

vs.

    <glob pattern="*.xhtml"/>
    <glob pattern="*.xht"/>
    <glob pattern="*.html"/>
    <glob pattern="*.htm"/>

Interestingly, when using the circleci/ruby:2.7.2-node image, the expected result was produced as this image has an older version of freedesktop.org.xml in which the mimes were sorted differently.

Thanks in advance for your assistance.

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

No branches or pull requests

1 participant