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

RuntimeException Layer and request path have gone out of sync for capitalised piped route #168

Closed jakeBarwell closed 6 years ago

jakeBarwell commented 6 years ago

Getting a RuntimeException "Layer and request path have gone out of sync" From zendframework/zend-stratigility/src/Next.php line 271

Code to reproduce the issue

Add piped route like this for example $app->pipe('/myadmin', \App\Middleware\Auth\AdminAuth::class);

Then via browser go to /MYADMIN (Note the capital letters)

Expected results

Either 404 or it matches that route

Actual results

RuntimeException "Layer and request path have gone out of sync"

jakeBarwell commented 6 years ago

Sorry that was on version 2.1.2 just upgraded to 2.2.1 and similar behaviour

Exception\PathOutOfSyncException thrown from src/Middleware/PathMiddlewareDecorator.php line 128

Looking at master branch, I do not think this will still be an issue.

weierophinney commented 6 years ago

Fixed with #169 and new 2.2.2 release; I'm preparing a patch for the 3.0 series as well.

weierophinney commented 6 years ago

The patch prepared for master, #170, only includes the unit test, as the behavior was already correct in that branch.