contributte / apitte

:wrench: An opinionated and enjoyable API framework based on Nette Framework. Supporting content negotiation, debugging, middlewares, attributes, annotations and loving openapi/swagger.
https://contributte.org/packages/contributte/apitte/
MIT License
61 stars 37 forks source link

Request header parameter fix #170

Closed miranovy closed 2 years ago

miranovy commented 2 years ago

Header request parameter "X-Auth-Token" should be provided.

$request->getHeaders() return headers names with upper letters (e.g. X-Auth-Token) and condition on line 135 (https://github.com/contributte/apitte/blob/master/src/Mapping/RequestParameterMapping.php#L135) is false becouse $headerParameterName always contains parameter name (e.g. x-auth-token) with lower letters. Therefore, I converted everything to lowercase.

f3l1x commented 2 years ago

Nice. Can you please add some tests?

miranovy commented 2 years ago

Added test containing header name in uppercase and lowercase letters

miranovy commented 2 years ago

@f3l1x Can you help me with failed static analysis under php 8.0?

f3l1x commented 2 years ago

Can you please rebase it? I think it will be OK.

f3l1x commented 2 years ago

Can you rebase it @miranovy?

f3l1x commented 2 years ago

Resolved via https://github.com/contributte/apitte/pull/188