-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
don't make default_type global #78
Comments
Old, but relevant Mozilla discussion about default types: https://issues.apache.org/bugzilla/show_bug.cgi?id=13986 (just dropping this here for reference. not expressing any opinion on how it may or may not apply here.) |
You make a good point about how the 'global' nature of default_type is problematic. Will have to digest this. Could you (in the mean time) just check (mime.lookup('foo') === mime.default_type) for now? I know it's less than ideal. :-/ |
Yeah not a big deal. Thanks! |
There's an easy workaround though, just make the |
when in doubt, do what the standard says, or in this case, do what the most common tools do. http://linux.die.net/man/1/file |
See #139 (plan is to have v2 return null instead of default type.) |
i'd prefer when a lookup fails, it returns something falsey like
false
instead ofapplication/octet-stream
. i would love to set the default type to something, but since it's global, i'm afraid it'll ruin other modules since this repo is used a lot.aside from doing a major version bump, how about adding a second "default" option to the methods?
would return a valid mime type or
false
The text was updated successfully, but these errors were encountered: