Skip to content

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

Closed

Description

@mcavage

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.

Activity

  1. broofa commented on Jun 15, 2017

    @broofa
    Owner

    Closing. No plan to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions