Skip to content

MIME::Types#type_for fails to resolve dotfile extensions like .htaccess - #277

Open
halllzA wants to merge 2 commits into
mime-types:mainfrom
halllzA:type_for-cant-fetch-dotfile
Open

MIME::Types#type_for fails to resolve dotfile extensions like .htaccess#277
halllzA wants to merge 2 commits into
mime-types:mainfrom
halllzA:type_for-cant-fetch-dotfile

Conversation

@halllzA

@halllzA halllzA commented Aug 11, 2026

Copy link
Copy Markdown

.htaccess was added in mime-types-data 3.2025.0514.
However, type_for strips the leading . when extracting the extension from a filename and matches against the stripped value, so dotfiles like .htaccess couldn't be resolved.

Repro script:

MIME::Types.type_for('.htaccess')

# => []

@halllzA

halllzA commented Aug 11, 2026

Copy link
Copy Markdown
Author

I'm sorry
I accidentally made changes to the main branch of my forked repository, which caused the PR to be closed.

Signed-off-by: Haruki Kobayashi <kobakun1124@gmail.com>
Signed-off-by: Haruki Kobayashi <kobakun1124@gmail.com>
@halllzA
halllzA force-pushed the type_for-cant-fetch-dotfile branch from e8aac5b to 51bec03 Compare August 11, 2026 08:15
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