Skip to content

FastRoute 0.3.0

Choose a tag to compare

@nikic nikic released this 26 Nov 19:19
· 193 commits to master since this release

This release fixes a routing bug, which could occur if two non-disjoint routes for different HTTP methods are defined:

$dispatcher = FastRoute\simpleDispatcher(function(FastRoute\RouteCollector $r) {
    $r->addRoute('GET',  '/user/{name}', 'GET with default placeholder pattern');
    $r->addRoute('POST', '/user/{name:[a-z]+}', 'POST with custom placeholder pattern');
});

A request to POST /user/foobar was previously rejected with 405 Method Not Supported and is now correctly matched.

For more information see #25.

This release changes the structure of the cached data (if cachedDispatcher is used), so the cache file should be removed after the update.