papsign / Ktor-OpenAPI-Generator

Ktor OpenAPI/Swagger 3 Generator
Apache License 2.0
244 stars 42 forks source link

Http headers should not be case sensitive #96

Closed sigmanil closed 3 years ago

sigmanil commented 3 years ago

Http headers received using the HeaderParam-anotation are interpreted in a case sensitive manner. This goes against the definition of such headers, which says they are case-insensitive. (https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2)

Wicpar commented 3 years ago

indeed, i have no time in the short term to do it but if anyone is up to do a PR i'll take it.

sigmanil commented 3 years ago

@Wicpar Made an attempt to fix this in the above pull request. I'm not sure I did it the best way possible (to be honest those "builders" almost defeated me), but tests seem to indicate it works at least. Maybe this gets us a bit closer?

Wicpar commented 3 years ago

The builders also almost defeated me, the openapi spec for the more advanced query formats is pure pain but i was happy once it was working. You unfortunately overshot a bit the scope of the issue by making query params case insensitive as well...

Wicpar commented 3 years ago

Release has been pushed. The fix was very simple after all, feel free to look at the commit: 46acb38 Sorry that you lost time on this.

sigmanil commented 3 years ago

@Wicpar As long as it's been fixed, I'm happy! :-) Thank you!