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

mime.extension() fails if the content-type is parameterized #74

Closed
mcavage opened this issue Oct 29, 2013 · 1 comment
Closed

mime.extension() fails if the content-type is parameterized #74

mcavage opened this issue Oct 29, 2013 · 1 comment

Comments

@mcavage
Copy link

mcavage commented Oct 29, 2013

Hello,

This used to work in mime:

mime.define({
    'application/x-foo; type=bar': ['baz']
});

assert.equal('baz', mime.extension('application/x-foo; type=bar'));

It no longer does, given the extension logic currently splits off parameters after the ; (it looks like there was a previous bug fix for this given charsets, etc.).

I would have sent a PR, but given the history there I'm not sure what you want to do with it; it sort of feels like you need an API flag that indicates whether you want "exact match" (modulo whitespace) or "parameterized match" or something that does what it does now.

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