From f9955ee2bc8695dbe7ecad091bb3f16dc4bed5bf Mon Sep 17 00:00:00 2001 From: Marcel Frankruijter Date: Sun, 17 Jan 2021 22:45:18 +0100 Subject: [PATCH] Fixed issue in path matching middleware --- CHANGELOG.md | 3 ++- src/Component/Middleware/PathMatchingMiddleware.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef040bd..e616d5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed issue where it was possible to get more output after a 404 was generated. +- Fixed issue path and route were not equally treated in path matching middleware. ## 3.0.0 - 2021-01-17 @@ -42,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The initial implementation of the package. # Versions -- [3.0.1 > Unreleased](https://github.com/ulrack/web/compare/3.0.0...HEAD) +- [3.0.1 > Unreleased](https://github.com/ulrack/web/compare/3.0.1...HEAD) - [3.0.0 > 3.0.1](https://github.com/ulrack/web/compare/3.0.0...3.0.1) - [2.0.0 > 3.0.0](https://github.com/ulrack/web/compare/2.0.0...3.0.0) - [1.0.1 > 2.0.0](https://github.com/ulrack/web/compare/1.0.1...2.0.0) diff --git a/src/Component/Middleware/PathMatchingMiddleware.php b/src/Component/Middleware/PathMatchingMiddleware.php index 48b5710..cc28c38 100644 --- a/src/Component/Middleware/PathMatchingMiddleware.php +++ b/src/Component/Middleware/PathMatchingMiddleware.php @@ -81,6 +81,7 @@ private function getParameters( string $path ): ?array { $route = trim($route, '/'); + $path = trim($path, '/'); $matchParam = preg_match( '/{[^\/]+}/',