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

lookup with extension-less file on Windows returns wrong type #68

Closed
seanmonstar opened this issue Aug 14, 2013 · 0 comments
Closed

lookup with extension-less file on Windows returns wrong type #68

seanmonstar opened this issue Aug 14, 2013 · 0 comments

Comments

@seanmonstar
Copy link

mime.define({ 'browserid': 'application/json' });

mime.lookup('/www/.well-known/browserid'); // application/json
mime.lookup('\\www\\.well-known\\browserid'); // application/octet-stream

This is because the regex matches well-known\\browserid. I can think of 2 fixes here:

  1. Add a backslash to the regex: /.*[\.\/\\]/g
  2. Or removing regexes, and relying on path: path.extname(file) || path.basename(file)
@broofa broofa closed this as completed in 8aac435 Aug 15, 2013
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