kogosoftwarellc / open-api

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

openapi-request-coercer: fix header coercing #802

Closed jakobw closed 2 years ago

jakobw commented 2 years ago

Header field names are case insensitive which was addressed to some extent in the code by lowercasing the properties of the coercers object (here via the l helper function). However, the function performing the coercion compared the original (non-lowercase) fields to the lowercase coercers properties (here), which doesn't work unless the header was lowercase to begin with.

This is fixed here by using the same lowercasing on the parameter name when checking for a matching coercer.

jakobw commented 2 years ago

Thanks! :)