kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
892 stars 235 forks source link

openapi-request-validator: make mimetype header case insensitive #809

Closed pulasthieka closed 2 years ago

pulasthieka commented 2 years ago

HTML headers are lowercase most of the time, but some applications (eg:AWS) may use a different case. In such cases headers like content-type can be sent as Content-Type.

The request validator is written to throw an error when the request body is required AND content-type header is not present. Currently this error is thrown if content-type header is not in lowercase.

This fixes this issue and makes the content-type header case-insensitive

pulasthieka commented 2 years ago

Requested changes made

jsdevel commented 2 years ago

@pulasthieka please get the build to pass

pulasthieka commented 2 years ago

@pulasthieka please get the build to pass

Changes made to code formatting and now passes local workflow.

pulasthieka commented 2 years ago

@jsdevel can you trigger a PR build workflow