zendframework / zend-stratigility

Middleware for PHP built on top of PSR-7 and PSR-15
BSD 3-Clause "New" or "Revised" License
235 stars 57 forks source link

Fixes path truncation in PathMiddlewareDecorator to be case insensitive #169

Closed weierophinney closed 6 years ago

weierophinney commented 6 years ago

In #168, we received a report indicating that path matching within PathMiddlewareDecorator fails if the path is the same, but using a different case.

Interestingly, we match it correctly; the problem is when preparing the truncated path to pass on to the decorated middleware, as it cannot identify the matched segment correctly.

This patch modifies the logic in getTruncatedPath() to do a case-insensitive comparison of the segment and the path in the initial condition.

This problem is likely relevant in current master as well, and will be ported to that branch on completion.

Fixes #168