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

Extensionless paths should return null or false #113

Closed
huyinghuan opened this issue Feb 4, 2015 · 5 comments
Closed

Extensionless paths should return null or false #113

huyinghuan opened this issue Feb 4, 2015 · 5 comments
Labels

Comments

@huyinghuan
Copy link

In general,

mime.lookup('/path/to/file.css');  // ==>  text/css   the result is ok
mime.lookup('file.css'); // ==>  text/css   the result is ok
mime.lookup('.css'); // ==>  text/css   the result is ok
mime.lookup('css'); // ==>  text/css   the result is ok
//but
mime.lookup('path/to/css');  // ==>  text/css  . the result is controversial
@broofa
Copy link
Owner

broofa commented Feb 4, 2015

What do you suggest the behavior should be?

@huyinghuan
Copy link
Author

I think it should be default value application/octet-stream when the parameter is a file path and it have not extension name.

@gsf
Copy link

gsf commented Mar 3, 2015

I just ran into this issue with a path like /admin/new/text that I expected to be application/octet-stream instead of text/plain.

@dougwilson
Copy link

The mime-types library, a similar library to this one, also had the same issue. If someone wants to copy/view our fix to incorporate here: jshttp/mime-types@f5e2eb2

@broofa broofa added the V2 label Jun 15, 2017
@broofa broofa changed the title path and mime controversial Extensionless paths should return null or false Jun 15, 2017
@broofa
Copy link
Owner

broofa commented Sep 15, 2017

Fixed in v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants