zend-stratigility v2.2.1 Release Notes
Release Date: 2018-04-04 // about 6 years ago-
โ Added
- Nothing.
๐ Changed
- Nothing.
๐ Deprecated
- Nothing.
โ Removed
- Nothing.
๐ Fixed
๐ #167 fixes an
issue with thePathMiddlewareDecorator
whereby it was using the original
request when invoking the handler it creates, instead of prepending the
๐ง configured path prefix to the request URI created. With the fix, if middleware
alters the request path passed to the handler, the changes will now propagate
to later middleware. As an example:new PathMiddlewareDecorator('/api', middleware(function ($request, $handler) {$uri = $request-\>getUri();if (! preg\_match('#^/v\d+/#', $uri-\>getPath())) {$request = $request-\>withUri($uri-\>withPath('/v1' . $uri-\>getPath())); }return $handler-\>handle($request);}));
For the request path
/api/books
, the above will now correctly result in
/api/v1/books
being propagated to lower layers of the application, instead of
/api/books
.