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

requested features #131

Closed
Somebi opened this issue Oct 8, 2015 · 3 comments
Closed

requested features #131

Somebi opened this issue Oct 8, 2015 · 3 comments

Comments

@Somebi
Copy link

Somebi commented Oct 8, 2015

Removing default octet mime type would be better... Just null would be nice.

And passing req.url with query parameters not working, only parsing url and passing parsed.pathname works. Would be nice to pass raw req.url and it gives proper mime.

@Somebi
Copy link
Author

Somebi commented Oct 8, 2015

here:
https://github.com/broofa/node-mime/blob/master/mime.js#L69

var results=path.match(/\.([a-z]+).*$/i);
if(results!==null && results[1]) {
var ext=results[1];
}
else {
return fallback || this.default_type;
}

return this.types[ext];

@Somebi
Copy link
Author

Somebi commented Oct 8, 2015

Regexp should be tested though.

@broofa
Copy link
Owner

broofa commented Jun 15, 2017

Re: default type, see #139.
Re: urls, I'm not a big fan of overloading method arguments (allowing
String or Url), and would prefer not to add another method for this.
So, for now, I'm okay leaving this as a problem for the caller. mime.lookup(req.url.replace(/\?.*/,'')) works.

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

2 participants