Skip to content

Use content-type fast parse#472

Open
blakeembrey wants to merge 1 commit into
fastify:mainfrom
blakeembrey:be/use-content-type
Open

Use content-type fast parse#472
blakeembrey wants to merge 1 commit into
fastify:mainfrom
blakeembrey:be/use-content-type

Conversation

@blakeembrey
Copy link
Copy Markdown

Preamble: I know fast-content-type-parse is intended to be a Fastify fork of content-type and is likely forked for historical reasons, but I recently released a content-type@2 and the changes seemed relevant to this package. Mostly because there's no need to parse parameters at all.

Changes fast-content-type-parse to use content-type with parameters: false to extract the content-type parameter.

However, the parser in content-type no longer validates during parse (designed to be lenient/fast) so there is a minor behavior change with invalid MIME types. If you sent something like foo it would currently throw during .parse but in this change it'll forward foo along.

Checklist

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

Successfully merging this pull request may close these issues.

1 participant