fastify / fastify-multipart

Multipart support for Fastify
MIT License
490 stars 103 forks source link

mimeType is converted to lowercase letters #531

Closed ritikrao1 closed 5 months ago

ritikrao1 commented 5 months ago

Prerequisites

Fastify version

4.26.2

Plugin version

8.3.0

Node.js version

14.18.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.5

Description

i have migrated from express to fastify, due to which i used fastify/multipart for multipart/form-data parsing but i am facing a issue here in previous setup we used to recieve file headers (i.e content-dispostion and content-type) which are missing here also, mimeType is also converted to lowercase letters we used to get 'imageJPEG' as mimetype but we now getting 'imagejpeg', this i causing issues as we have set strict mimetype checks in many microservices.

Link to code that reproduces the bug

No response

Expected Behavior

to get file headers or preserve original mimeType i.e content-type info

jsumners commented 5 months ago

https://www.rfc-editor.org/rfc/rfc2045#section-5.1

The type, subtype, and parameter names are not case sensitive. For example, TEXT, Text, and TeXt are all equivalent top-level media types.